On 4/30/07, Lino Mastrodomenico <[EMAIL PROTECTED]> wrote:
> 2007/4/30, Tim Delaney <[EMAIL PROTECTED]>:
> > 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.

Most definitely not. If you don't even know whether you're defining or
overriding a method you shouldn't be using super in the first place,
because you're *obviously* not engaged in cooperative MI.

And don't get me started abut __init__. Constructors don't do
cooperative MI, period.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to