__init__ concerns

Erik Max Francis max at alcyone.com
Mon Dec 10 23:46:34 EST 2001


Peter Wang wrote:

> what is the proper python
> idiom (or, failing that, the proper technique) for ensuring that a
> subclass instance is properly initialized, especially when details of
> the base class are unknown?

I don't understand the circumstances under which the arguments to a base
class constructor would be unknown.  You're not picking base classes at
random, a class will require a certain base class and will be dependent
on it.  Therefore, it will know the necessary arguments to pass to its
constructor.

Under what circumstances would you truly not know?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list