OOP / language design question

Heiko Wundram me+python at modelnine.org
Tue Apr 25 06:48:53 EDT 2006


Am Dienstag 25 April 2006 12:34 schrieb cctv.star at gmail.com:
> I was wondering, why you always have to remember to call bases'
> constructors explicitly from the derived class constructor? Why hasn't
> this been enforced by the language?

Because sometimes you don't want to call the base classes constructors? The 
Python zen says: "Better explicit than implicit," and in this case it hits 
the nail on the head. Better to see right away what your code does (the 
explicit call to the base class), than to have to work around calling a bases 
constructor if you don't want to call it.

--- Heiko.



More information about the Python-list mailing list