Inheritance and forward references (prototypes)
bruno.42.desthuilliers at websiteburo.invalid
Mon Jun 22 11:21:23 CEST 2009
Piet van Oostrum a écrit :
>>>>>> Steven D'Aprano <steve at REMOVETHIS.cybersource.com.au> (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