Gregory Ewing wrote:
Raymond Hettinger wrote:
Every class
in the MRO implementing the target method *must* call super() to give
the next class in the MRO a chance to run.

EXCEPT for the last one, which must NOT call super!

The posted example happens to work because object has
a default __init__ method that does nothing. But this
is not generally true of other methods, which means you
need a "terminating" class at the end of the MRO whose
methods don't call super.

Speaking of new-style classes only, don't they all end in object? And if the MRO is only known at run-time, how is one to know at code-time whether your (new-style) class is at the end of the line?

~Ethan~

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to