[Python-ideas] Required to call superclass __init__
scott+python-ideas at scottdial.com
Thu Nov 15 09:14:25 CET 2007
Jim Jewett wrote:
> I don't yet
> see what those simplifications should actually be, but maybe someone
> else will if you publish and wait long enough.
The first thing I noticed was that the naming scheme is confusing.
Between required_super and super_required, neither of them indicate to
me which is the function decorator and which is the base class.
Furthermore, I don't see why required_super (the base class) needs a
distinct name. Perhaps I am being a bit to clever, but couldn't we just
overload the __new__ method of the base class.
def __new__(cls, *func):
if len(func) > 0:
Leaving your example now being spelled as:
I can't think of a case that the the base class would ever be passed
arguments, so this seems ok and rids us of the naming oddities.
scott at scottdial.com
scodial at cs.indiana.edu
More information about the Python-ideas