supermethod shortcut

Michele Simionato michele.simionato at poste.it
Fri May 28 08:58:17 EDT 2004


huy <nytimes at swiftdsl.com.au> wrote in message news:<40b6c250$0$2299$61ce578d at news.syd.swiftdsl.com.au>...
> 
> This recipe is nice. It would be nicer if it became the standard when 
> doing OOP in python. I always disliked the current super call in python; 
> too much implementation detail in the syntax IMO.
> 
> Huy

>From http://www.python.org/2.2.2/descrintro.html#cooperation:

"""
The super call as shown above is somewhat prone to errors: it is easy
to copy and paste a super call from one class to another while
forgetting to change the class name to that of the target class, and
this mistake won't be detected if both classes are part of the same
inheritance graph. (You can even cause infinite recursion by
mistakenly passing in the name of a derived class of the class
containing the super call.) It would be nice if we didn't have to name
the class explicitly, but this would require more help from Python's
parser than we can currently get. I hope to fix this in a future
Python release by making the parser recognize super.
"""

This is Guido's own saying.

                 Michele Simionato



More information about the Python-list mailing list