new-style class initialization

Martin von Loewis loewis at informatik.hu-berlin.de
Sun Mar 17 12:43:29 EST 2002


"robin and jim" <robinjim at earthlink.net> writes:

> What is the correct way to write the following where the number of
> arguments to the initializer changes throughout the inheritance
> hierarchy?

If you need to know exactly which base initializers to call and what
arguments to give them, super() is not the right way to do
that. Instead, you will need to explicitly say which initializer to
call, e.g. via

   A.__init__(self, 'B')

HTH,
Martin




More information about the Python-list mailing list