``super`` with only one argument ("bound" super) is a mess.
AFAICT ``super(C)`` is intended to be used as an attribute in
other classes. Then the descriptor magic will automatically convert the
unbound syntax in the bound syntax. For instance:
>>> class B(object):
... a = 1
>>> class C(B):
.
Greg Chapman wrote:
> Steven Bethard wrote:
>
> > When would you call super with only one argument? The only examples
> > I can find of doing this are in the test suite for super.
> >
>
> I think it's to allow something like this:
>
> class A(B, C):
> __super = super(A)
> def foo(self
Steven Bethard wrote:
> When would you call super with only one argument? The only examples
> I can find of doing this are in the test suite for super.
>
I think it's to allow something like this:
class A(B, C):
__super = super(A)
def foo(self):
return self.__super.foo()
This
No, you should use the version with two arguments for that.
The second argument would be a class however, not an instance.
Example:
class C(object):
@staticmethod
def f():
print "C.f"
class D(C):
@staticmethod
def f():
print "D.f"
super(D, D).f()
D.f()
Ju
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I asked myself the same question and I am not convinced
that using 'super' with one argument really makes sense
(i.e. IMO it is more a liability than an asset). BTW, I have a set
of notes on the tricky aspects of 'supe
I asked myself the same question and I am not convinced
that using 'super' with one argument really makes sense
(i.e. IMO it is more a liability than an asset). BTW, I have a set
of notes on the tricky aspects of 'super' you may be interested in.
Michele Simionato
--
http://mail.pyth