Re: super with only one argument

2005-03-17 Thread Michele Simionato
``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): ...

Re: super with only one argument

2005-03-17 Thread Greg Chapman
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

Re: super with only one argument

2005-03-17 Thread Greg Chapman
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.__sup

Re: super with only one argument

2005-03-14 Thread Michele Simionato
super(D, D).f() D.f() Just using super(D).f() would not work. ``super`` with only one argument is a recipe for headaches. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super with only one argument

2005-03-14 Thread John Roth
"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

Re: super with only one argument

2005-03-14 Thread Michele Simionato
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

super with only one argument

2005-03-14 Thread Steven Bethard
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. Playing around with it: py> class A(object): ... x = 'a' ... py> class B(A): ... x = 'b' ... py> s = super(B) py> s.x Traceback