Am 28.05.2011 01:57 schrieb sturlamolden:

Yes. And opposite: CPython cannot know that builtin super() is not
called,
even if it does not see the name 'super'. I can easily make foo()
alias super().

Another alternative would have been to make use of __xxx magic.

If every class had an "automatically available" attribute, e. g. __<classname>_classname which thus could be accessed via __classname from inside, keeping the 2.x syntax would have been the best, using super(__classname, self).


In both cases, the cure is a keyword -- or make sure that __class__
is always defined.

If super is to be I keyword, we could argue that self and cls should
be keywords as well, and methods should always be bound. That speaks in
favour of a super() function. But then it should always be evaluated at run-
time, without any magic from the parser.

Magic functions belong in Perl, not Python.

ACK.


Thomas
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to