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

Robert Kern robert.kern at gmail.com
Tue Apr 11 12:54:14 EDT 2006


Wildemar Wildenburger wrote:
> Aahz wrote:
> 
>>Classic classes are *NOT* deprecated.
> 
> I'm surprised ...
> So there will be two (in most cases subtly) different classes of classes 
> (so to speak) for all eternity?

No, Python 3.0, the backwards-compatibility-breaking release, will remove them.
"Deprecated" has a rather specific meaning for Python language features and
doesn't really apply to classic classes, yet.

  http://www.python.org/dev/peps/pep-0005/

> Why is that? Do classic classes have some advantage over new style ones? 
> If so, what are they?

There's a slight speed advantage in some places, but nothing you should worry
about. I, at least, would recommend always using new classes in new code unless
if you are sure you need classic classes.

-- 
Robert Kern
robert.kern at gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list