What is NotImplemented ?

Alex Martelli aleax at aleax.it
Sat Apr 27 18:35:59 EDT 2002


Magnus Lie Hetland wrote:
        ...
> But how is this different from raising NotImplementedError? (If that
> doesn't work in this case, why doesn't it?)

Because raising NotImplementedError means "this method is abstract
in this class, it MUST be overridden by concrete subclasses".  That's
quite different from "try alternate ways" such as:

>>Returning NotImplemented from the __add__ makes Python go off and call
>>the __radd__ method.


Alex




More information about the Python-list mailing list