average wrote:
> It seems that the frustration with super revolves around how Python
> currently conflates (as well as many users) two very different types
> of inheritance, both "is-a" and "has-a" (or compositional)
> inheritance. Unfortunately, Python assists this confusion because the
> languag
It seems that the frustration with super revolves around how Python
currently conflates (as well as many users) two very different types
of inheritance, both "is-a" and "has-a" (or compositional)
inheritance. Unfortunately, Python assists this confusion because the
language doesn't provide a disti
On Sat, Aug 30, 2008 at 6:16 AM, Michele Simionato
> I wrote a trait library which I plan to release soon or later.
Ok, just for the people here that cannot wait I have prepared a pre-alpha
snapshot and uploaded it to my site:
http://www.phyast.pitt.edu/~micheles/python/strait.html
At some momen
On Fri, Aug 29, 2008 at 8:33 PM, Casey Duncan <[EMAIL PROTECTED]> wrote:
> - There are good alternatives to multiple inheritance for many cases, but
> there are cases where multiple inheritance is arguably best.
Maybe, but I am still biased in the opposite direction ;)
>Traits are a
> possible al
From: <[EMAIL PROTECTED]>
I think it would benefit everyone if this discussion would end up with
some patches to the library documentation that documented the semantics
of super() more completely in the reference documentation and the
"multiple inheritance" area of the tutorial, so that when pe
On 06:33 pm, [EMAIL PROTECTED] wrote:
On Aug 29, 2008, at 11:46 AM, Michele Simionato wrote:
On Fri, Aug 29, 2008 at 6:15 PM, Nick Coghlan <[EMAIL PROTECTED]>
wrote:
I am very well aware of the collection module and the ABC mechanism.
However, you are missing that mixins can be implemented in
On Aug 29, 2008, at 11:46 AM, Michele Simionato wrote:
On Fri, Aug 29, 2008 at 6:15 PM, Nick Coghlan <[EMAIL PROTECTED]>
wrote:
The mixin methods in the ABC machinery would be a lot less useful
without multiple inheritance (and the collections ABCs would be a
whole
lot harder to define and
On Fri, Aug 29, 2008 at 6:15 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> The mixin methods in the ABC machinery would be a lot less useful
> without multiple inheritance (and the collections ABCs would be a whole
> lot harder to define and to write).
>
> So if you're looking for use cases for mul
Michele Simionato wrote:
> OTOH, for what concerns multiple inheritance, I am still not
> convinced it is really worth it. I mean, the MRO is beautiful,
> elegant and all that on paper, but on real-life code things as different,
> especially from the side of the users of frameworks heavily
> based
On Fri, Aug 29, 2008 at 6:22 AM, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> You're right, let's abolish inheritance, too, because then you might have to
> read more than one class to see what's happening.
You are joking, but I actually took this idea quite seriously. Once
(four years ago or so) I
At 06:07 AM 8/29/2008 +0200, Michele Simionato wrote:
On Thu, Aug 28, 2008 at 8:54 PM, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> I created a "universal metaclass" in
> DecoratorTools whose sole function is to delegate metaclass __new__,
> __init__, and __call__ to class-level methods (e.g. __cl
On Thu, Aug 28, 2008 at 8:54 PM, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> I created a "universal metaclass" in
> DecoratorTools whose sole function is to delegate metaclass __new__,
> __init__, and __call__ to class-level methods (e.g. __class_new__,
> __class_call__, etc.), thereby eliminating
Michele Simionato wrote:
Notice that I was discussing an hypothetical language. I was arguing
that in principle
one could write a different language from Python, with single inheritance only,
and not lose much expressivity. I am not advocating any change to
current Python.
Since this is a li
At 05:50 PM 8/28/2008 +0200, Michele Simionato wrote:
On Aug 28, 5:30 pm, "Phillip J. Eby" <[EMAIL PROTECTED]> wrote:
> How is that making things easier for application programmers?
We have different definitions of "application programmer". For me a typical
application programmer is somebody who
Greg,
Do you have a real-life example of this where multiple
inheritance is actually used?
I have built a framework that I have called the "capability pattern"
which uses multiple inheritance in a way that might be unique (I'm not
familiar enough with other frameworks to know for sure).
T
On Aug 28, 5:30 pm, "Phillip J. Eby" <[EMAIL PROTECTED]> wrote:
> How is that making things easier for application programmers?
We have different definitions of "application programmer". For me a typical
application programmer is somebody who never fiddles with metaclasses,
which are the realm of
At 06:35 AM 8/28/2008 +0200, Michele Simionato wrote:
Multiple inheritance of metaclasses is perhaps
the strongest use case for multiple inheritance, but is it strong
enough? I mean, in real code how many times did I need that?
I would not mind make life harder for gurus and simpler for
applicati
Alex Martelli wrote:
> What's DebugFrameworkMeta2? I assume it's some kind of mix but I
> don't see it defined anywhere so I'm having to guess.
Sorry Alex, here is definition which got lost in cut&paste:
DebugFrameworkMeta2 = include_mixin(DebugMeta2, FrameworkMeta2)
> I'd like to understand wh
M.-A. Lemburg wrote:
The typical use is in mixin classes that can be used to
add functionality to base classes...
But this is just another waffly made-up example. I'm
talking about real-life use cases from actual code
that's in use.
--
Greg
___
Pyth
On Wed, Aug 27, 2008 at 4:30 PM, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Maybe you could help me understand this by giving a fully executable
> Python snippet using __bases__[0] instead of the hypothetical
> __base__?
Sorry Alex, I have the fully functional snippet but evidently I have
sent som
On Tue, Aug 26, 2008 at 10:24 PM, Michele Simionato
<[EMAIL PROTECTED]> wrote:
...
> .. code-block:: python
>
> def include_mixin(mixin, cls): # could be extended to use more mixins
> # traits as in Squeak take the precedence over the base class
> dic = vars(mixin).copy() # could be ext
On 2008-08-27 09:54, Greg Ewing wrote:
> Do you have a real-life example of this where multiple
> inheritance is actually used?
>
> A non-contrived example or two would be a good thing to
> have in tutorials etc. where super() is discussed. It
> would help to convey the kinds of situations in whic
Phillip J. Eby wrote:
ISTR pointing out on more than one occasion that a major use case for
co-operative super() is in the implementation of metaclasses. The
__init__ and __new__ signatures are fixed, multiple inheritance is
possible, and co-operativeness is a must
Do you have a real-life e
On Tue, Aug 26, 2008 at 11:10 PM, Steve Holden <[EMAIL PROTECTED]> wrote:
> If you aren't aware of it you should take a look at Enthought's traits
> package. It's part of the Enthought Tool Suite (ETS).
I know of the existence of that framework, however it is quite
large and I don't see the relati
On Wed, Aug 27, 2008 at 5:15 AM, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> ISTR pointing out on more than one occasion that a major use case for
> co-operative super() is in the implementation of metaclasses. The __init__
> and __new__ signatures are fixed, multiple inheritance is possible, and
On Tue, Aug 26, 2008 at 6:13 PM, Michele Simionato
<[EMAIL PROTECTED]> wrote:
> I not completely against multiple inheritance. I am against multiple
> inheritance
> as it is now. A restricted form of multiple inheritance in which mixins
> classes
> are guaranteed to be orthogonal would be fine wi
On Wed, Aug 27, 2008 at 3:30 AM, Alex Martelli <[EMAIL PROTECTED]> wrote:
> On Tue, Aug 26, 2008 at 6:16 PM, Michele Simionato
> <[EMAIL PROTECTED]> wrote:
> ...
>> It is just a matter of how rare the use cases really are. Cooperative
>> methods has been introduced 6+ years ago. In all this time
At 03:16 AM 8/27/2008 +0200, Michele Simionato wrote:
It is just a matter of how rare the use cases really are. Cooperative
methods has been introduced 6+ years ago. In all this time surely
they must have been used. How many compelling uses of cooperation
we can find in real life code? For instan
On Tue, Aug 26, 2008 at 6:16 PM, Michele Simionato
<[EMAIL PROTECTED]> wrote:
...
> It is just a matter of how rare the use cases really are. Cooperative
> methods has been introduced 6+ years ago. In all this time surely
> they must have been used. How many compelling uses of cooperation
> we c
On Tue, Aug 26, 2008 at 8:56 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> I would state this differently: "The use cases for cooperative multiple
> inheritence don't arise often in practice; so, if we dropped support
> for those cases, you probably wouldn't notice until you encountered
> one
Michele Simionato wrote:
> On Tue, Aug 26, 2008 at 5:32 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
[...]
>> I think it is a non-sequiter to reason from "diamond diagrams are
>> complicated" to "mixins should be disallowed". Instead, I think it better
>> to simply recommend that a key to happ
[Raymond]
Cooperative multiple inheritance is *not* about mixing two unrelated
parents that just happen to use the same method name but have
different semantics and were not designed to cooperate with each other.
The A-B-C-D diagrams and foo/bar methods in the examples are
deceptive because they
On Tue, Aug 26, 2008 at 5:32 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> What I would really like to see is a fourth blog entry that shows
> how to use super() reliably and correctly.
That could be arranged.
> In general, I opposed
> to creating documentation in the form of "danger, danger
[Michele Simionato]
Recently I have opened a blog on Artima and I am publishing a
few Python-related essays I had in store. In particular a trilogy
of papers about "super". From the foreword:
"""
In 2004 I decided to write a comprehensive paper documenting
``super`` pitfalls and traps, ...
Th
On Aug 24, 3:43 pm, "Matt Giuca" <[EMAIL PROTECTED]> wrote:
> Hi Michele,
>
> Do you have a URL for this blog?
>
Sorry, here it is:
http://www.artima.com/weblogs/index.jsp?blogger=micheles
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.p
Hi Michele,
Do you have a URL for this blog?
Matt
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Recently I have opened a blog on Artima and I am publishing a
few Python-related essays I had in store. In particular a trilogy
of papers about "super". From the foreword:
"""
In 2004 I decided to write a comprehensive paper documenting
``super`` pitfalls and traps, with the goal of publishing it
37 matches
Mail list logo