Why new Python 2.5 feature "class C()" return old-style class ?

Wildemar Wildenburger wildemar at freakmail.de
Thu Apr 13 08:20:20 EDT 2006


Petr Prikryl wrote:
> My question: Could the old classes be treated in
> a new Python treated as new classes with "implicit"
> base object? (I know the Zen... ;-)
>
> Example: I use usually a very simple classes. When I add
> "(object)" to my class definitions, the code continues to
> works fine -- plus I have new features to use.
> Why this cannot be done automatically? What could
> be broken in the old code if it was threated so?
>
> Thanks for explanation,
>    pepr
Well, apparently this is exactly whats going to happen in the future, 
but not until Python 3.0.
Simple as that.

But I guess I'll just keep adding the (object) appendix even after that, 
so all my class definitions get syntax highlighting. Also it clarifies 
"what the score is" (to paraphrase Bender).

wildemar



More information about the Python-list mailing list