[Python-3000] super() PEP

Lino Mastrodomenico l.mastrodomenico at gmail.com
Tue May 1 00:36:07 CEST 2007


2007/4/30, Tim Delaney <tcdelaney at optusnet.com.au>:
> Fine with me. Calvin - want to send me your latest draft, and I'll do some
> modifications? I think we've got to the point now where we can take this
> off-list.

One more thing: what do people think of modifying super so that when
it doesn't find a method instead of raising AttributeError it returns
something like "lambda *args, **kwargs: None"?

Optionally this can be a constant (e.g. default_method) defined
somewhere so, if necessary, it's still possible to detect if the value
of super.meth is a real method or the "fake" default_method.

I think this can be useful when a method *doesn't know* if it's the
last in the MRO because it may depend on the inheritance hierarchy of
its subclasses: you can always simply call super.meth(...) and if the
current method is the last this will be a NOP.

-- 
Lino Mastrodomenico
E-mail: l.mastrodomenico at gmail.com


More information about the Python-3000 mailing list