Inheritance and forward references (prototypes)

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Mon Jun 22 05:21:23 EDT 2009

Piet van Oostrum a écrit :
>>>>>> Steven D'Aprano <steve at> (SD) wrote:
>> SD> # A.__base__ = DebugA  ## Uncomment this line for debugging.
>>>> A.__base__ = DebugA
> TypeError: readonly attribute
> Make that: A.__bases__ = DebugA,

or even better (readability-wise):

    A.__bases__ = (DebugA,)

Just the same thing, but at least you wont neither miss the ',' no 
wonder wether it's a typo or the author really wanted a tuple.

More information about the Python-list mailing list