Steven D'Aprano wrote:
> class super(object)
> | super(type) -> unbound super object
> | super(type, obj) -> bound super object; requires isinstance(obj,
> | type) super(type, type2) -> bound super object; requires
> | issubclass(type2, type) Typical use to call a cooperative
> | superclass m
On Sep 20, 4:31 pm, "Marshall T. Vandegrift" <[EMAIL PROTECTED]>
wrote:
> Michele Simionato <[EMAIL PROTECTED]> writes:
> > I am not against mixins (even if I am certainly very much against the
> > *abuse* of mixins, such as in Zope 2). What I would advocate (but I
> > realize that it will never ha
Michele Simionato <[EMAIL PROTECTED]> writes:
> I am not against mixins (even if I am certainly very much against the
> *abuse* of mixins, such as in Zope 2). What I would advocate (but I
> realize that it will never happen in Python) is single inheritance +
> mixins a la Ruby.
Ruby might be a ba
Ben Finney <[EMAIL PROTECTED]> writes:
>> The definition of superclass is not the issue, the issue is
>> "superclass *of which class*"? You expect super(A, self) to iterate
>> only over superclasses of A, even when self is an instance of a
>> subtype of A.
>
> Yes. Those are the specific paramete
On Sep 19, 3:41 pm, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> On Sep 19, 3:22 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
> wrote:
>
> > Ben Finney <[EMAIL PROTECTED]> wrote:
>
> > > If a function is named 'super' and operates on
> > >classes, it's a pretty strong implication that it's about
> >
On Thu, 20 Sep 2007 13:36:41 +1000, Ben Finney wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>
>> On Thu, 20 Sep 2007 12:00:40 +1000, Ben Finney wrote:
>>
>> > In its latter form, it is worthless to me when I'm looking for "get
>> > superclass of A", but its name and parameters and docume
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Thu, 20 Sep 2007 12:00:40 +1000, Ben Finney wrote:
>
> > In its latter form, it is worthless to me when I'm looking for
> > "get superclass of A", but its name and parameters and
> > documentation all lead me very strongly to believe otherwise.
>
On Thu, 20 Sep 2007 12:00:40 +1000, Ben Finney wrote:
> In its latter form, it is worthless to me when I'm looking for "get
> superclass of A", but its name and parameters and documentation all lead
> me very strongly to believe otherwise.
Why are you looking for the superclass of A?
If it is sp
On Sep 19, 8:14 pm, Ed Leafe <[EMAIL PROTECTED]> wrote:
> On Sep 19, 2007, at 6:52 AM, Michele Simionato wrote:
>
> > Well, I am personally *against* multiple inheritance (i.e. IMO it
> > gives more troubles than advantages)
>
> For the sorts of examples that have been used in this thread,
Scott David Daniels <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > [EMAIL PROTECTED] (Alex Martelli) writes:
> >
> >> In general, "a superclass of foo" means "a class X such that foo is a
> >> sublass of X"
> >
> > Sure. However, this doesn't equate to the assertion that "next class
> > in th
Scott David Daniels <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > [EMAIL PROTECTED] (Alex Martelli) writes:
> >
> >> In general, "a superclass of foo" means "a class X such that foo is a
> >> sublass of X"
> >
> > Sure. However, this doesn't equate to the assertion that "next class
> > in th
Scott David Daniels <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > [EMAIL PROTECTED] (Alex Martelli) writes:
> >
> >> In general, "a superclass of foo" means "a class X such that foo is a
> >> sublass of X"
> >
> > Sure. However, this doesn't equate to the assertion that "next class
> > in th
Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> Ben Finney <[EMAIL PROTECTED]> writes:
>
> > Evan is claiming that "the next class in the MRO _is_ a superclass",
> > apparently by his definition or some other that I've not seen.
>
> The definition of superclass is not the issue, the issue is
> "supe
Ben Finney wrote:
> [EMAIL PROTECTED] (Alex Martelli) writes:
>
>> In general, "a superclass of foo" means "a class X such that foo is a
>> sublass of X"
>
> Sure. However, this doesn't equate to the assertion that "next class
> in the MRO is the superclass", which is what I was responding to.
>
On Sep 19, 2007, at 6:52 AM, Michele Simionato wrote:
> Well, I am personally *against* multiple inheritance (i.e. IMO it
> gives more troubles than advantages)
For the sorts of examples that have been used in this thread, it
isn't MI that's problematic; it's the poor quality of the de
On 2007-09-19, Michele Simionato <[EMAIL PROTECTED]> wrote:
> On Sep 19, 3:22 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
> wrote:
>> Ben Finney <[EMAIL PROTECTED]> wrote:
>>
>> > If a function is named 'super' and operates on
>> >classes, it's a pretty strong implication that it's about
>> >superclas
On Sep 19, 3:22 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
>
> > If a function is named 'super' and operates on
> >classes, it's a pretty strong implication that it's about
> >superclasses.
>
> But it doesn't (under normal circumstances) operate on class
Ben Finney <[EMAIL PROTECTED]> wrote:
> If a function is named 'super' and operates on
>classes, it's a pretty strong implication that it's about
>superclasses.
But it doesn't (under normal circumstances) operate on classes.
It operates on an *instance*. And what you get back is a (proxy
to) a su
Michele Simionato wrote:
... interesting stuff ommitted
super seems to return an object of type super, but I cannot seem to find any
documention on this type except for 3.4.2.3
"Super Binding
If a is an instance of super, then the binding super(B, obj).m() searches
obj.__class__.__mro__ for
On 2007-09-19, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Ben Finney <[EMAIL PROTECTED]> writes:
>
>> Hrvoje Niksic <[EMAIL PROTECTED]> writes:
>>
>>> class X(Y):
>>> def foo(self):
>>> super(X, self).foo()
>>>
>>> ...there is in fact no guarantee that super() calls a superclass of
>>> X. H
Michele Simionato <[EMAIL PROTECTED]> writes:
> On Sep 19, 1:16 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>> Your arguments against the superclass term seem to assume that there
>> is only a single superclass to a particular class.
>
> If you say "the" superclass, then you also assume it is uni
Michele Simionato a écrit :
> On Sep 19, 12:36 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>
>> The next class in the MRO *is* a superclass of the *instance*. Else it
>> wouldn't be in the MRO !-)
>
> Bruno, there is no such a thing as a superclass in a multiple
> inheritance
May I disagr
On Sep 19, 1:16 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Your arguments against the superclass term seem to assume that there
> is only a single superclass to a particular class.
If you say "the" superclass, then you also assume it is unique. But
the big issue
is that the order of the method
Michele Simionato <[EMAIL PROTECTED]> writes:
> On Sep 19, 12:36 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>
>> The next class in the MRO *is* a superclass of the *instance*. Else it
>> wouldn't be in the MRO !-)
>
> Bruno, there is no such a thing as a superclass in a multiple
> inherita
On Sep 19, 12:36 pm, Bruno Desthuilliers wrote:
> The next class in the MRO *is* a superclass of the *instance*. Else it
> wouldn't be in the MRO !-)
Bruno, there is no such a thing as a superclass in a multiple
inheritance
world, and it is a very bad idea to continue to use that terminology.
I
Ben Finney a écrit :
> Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
>
>> Ben Finney a écrit :
>>> Evan Klitzke <[EMAIL PROTECTED]> writes:
On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote:
> [the 'super' function] doesn't return the superclass, it returns
> the next class in the
Ben Finney <[EMAIL PROTECTED]> writes:
> Evan is claiming that "the next class in the MRO _is_ a superclass",
> apparently by his definition or some other that I've not seen.
The definition of superclass is not the issue, the issue is
"superclass *of which class*"? You expect super(A, self) to i
Ben Finney <[EMAIL PROTECTED]> writes:
> Hrvoje Niksic <[EMAIL PROTECTED]> writes:
>
>> class X(Y):
>> def foo(self):
>> super(X, self).foo()
>>
>> ...there is in fact no guarantee that super() calls a superclass of
>> X. However, it is certainly guaranteed that it will call a superclass
>
Ben Finney <[EMAIL PROTECTED]> writes:
> Possibly the name 'next_in_mro', while ugly, would at least match the
> actual behaviour of this function.
In common lisp there's (call-next-method ...)
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber <[EMAIL PROTECTED]> writes:
> Try to interpret it as:
My point exactly. If a function is named 'super' and operates on
classes, it's a pretty strong implication that it's about
superclasses. Any explanation that begins "Try to interpret it as" and
then goes on to explain t
On Sep 18, 12:15 am, Ben Finney <[EMAIL PROTECTED]> wrote:
> Howdy all,
>
> After banging my head against super() trying to reliably get
> attributes of a superclass, I gained a little enlightenment when this
> turned up in a search:
>
> "Python's Super is nifty, but you can't use it
> (Pre
Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> class X(Y):
> def foo(self):
> super(X, self).foo()
>
> ...there is in fact no guarantee that super() calls a superclass of
> X. However, it is certainly guaranteed that it will call a superclass
> of type(self).
Not even that. It could call *an
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> Ben Finney a écrit :
> > Evan Klitzke <[EMAIL PROTECTED]> writes:
> >> On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote:
> >>> [the 'super' function] doesn't return the superclass, it returns
> >>> the next class in the MRO, whether that's a sup
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> If a class X is in the MRO of call Y, then X is a superclass of Y. I
> agree that the documentation for super is somewhat misleading (and
> obviously wrong), but it still *give access to* (at least one of)
> the superclass(es).
I believe the confu
Ben Finney a écrit :
> Evan Klitzke <[EMAIL PROTECTED]> writes:
>
>> On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote:
>>> Why does the documentation of 'super' say that it returns the
>>> superclass when *that's not true*? It doesn't return the
>>> superclass, it returns the next class in the
On Tue, 18 Sep 2007 15:38:46 +1000, Ben Finney wrote:
> Evan Klitzke <[EMAIL PROTECTED]> writes:
>
>> If you're using multiple inheritance, and you're _not_ using super
>> everywhere, then your code is broken anyway.
>
> This seems to support the notion that 'super' is unusable. If I inherit
> fr
Sorry, I read your message too fast and responded to the wrong point
:-)
[EMAIL PROTECTED] (Alex Martelli) writes:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> > Am I mistaken in thinking that "superclass of foo" is equivalent
> > to "parent class of foo"? If so, I'd lay heavy odds that I'm not
> >
[EMAIL PROTECTED] (Alex Martelli) writes:
> In general, "a superclass of foo" means "a class X such that foo is a
> sublass of X"
Sure. However, this doesn't equate to the assertion that "next class
in the MRO is the superclass", which is what I was responding to.
--
\ "Even if the voice
Evan Klitzke <[EMAIL PROTECTED]> writes:
> If you're using multiple inheritance, and you're _not_ using super
> everywhere, then your code is broken anyway.
This seems to support the notion that 'super' is unusable. If I
inherit from code that isn't under my control, and then use super(),
my code
Ben Finney <[EMAIL PROTECTED]> wrote:
> Am I mistaken in thinking that "superclass of foo" is equivalent to
> "parent class of foo"? If so, I'd lay heavy odds that I'm not alone in
> that thinking.
"That thinking" (confusing "parent" with "ancestor") makes sense only
(if at all) in a single-inher
Evan Klitzke <[EMAIL PROTECTED]> writes:
> On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote:
> > Why does the documentation of 'super' say that it returns the
> > superclass when *that's not true*? It doesn't return the
> > superclass, it returns the next class in the MRO, whether that's a
> >
On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote:
> Howdy all,
>
> After banging my head against super() trying to reliably get
> attributes of a superclass, I gained a little enlightenment when this
> turned up in a search:
>
> "Python's Super is nifty, but you can't use it
> (Previou
42 matches
Mail list logo