[Python-Dev] a patch to inspect and a non-feature request

Michele Simionato michele.simionato at gmail.com
Thu May 12 16:58:57 CEST 2005


On 5/12/05, Steven Bethard <steven.bethard at gmail.com> wrote:
>super doesn't work with "meta-attributes" and classmethods:
> 
> py> super(C, C).__name__
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
> AttributeError: 'super' object has no attribute '__name__'

Actually this is the Right Thing to do for super. It is something
to be aware of, not something to change. Since __name__ is
a descriptor defined in the type metaclass and not an attribute
defined in the base class, super correctly does not retrieve it.
It is enough to add some documentation about "super" caveats
and nonobvious points.
What I really dislike is super called with only one argument since
it has many unpleasant surprises and not real advantages :-(
               
Michele Simionato


More information about the Python-Dev mailing list