why are people still using classic classes?
steve at holdenweb.com
Fri Jan 14 22:53:30 CET 2005
Michael Hobbs wrote:
> Simon Wittber <simonwittber at gmail.com> wrote:
>>I've noticed that a few ASPN cookbook recipes, which are recent
>>additions, use classic classes.
>>I've also noticed classic classes are used in many places in the
>>I've been using new-style classes since Python 2.2, and am suprised
>>people are still using the classic classes.
>>Is there a legitimate use for classic classes that I am not aware of?
>>Is there a project to specifically migrate standard library classes to
> I'm guessing that the biggest contributor to the continued prevalence
> of classic classes is the official Python Tutorial:
> I came into Python around the 2.2 timeframe and used the tutorial as
> my starting point. I had often read people referring to "classic
> classes" but assumed that it was some old pre-2.2 thing that I need
> not worry about. For the longest time, I had assumed that I was using
> new style classes because I created them exactly as prescribed in the
> 2.2 tutorial (which still hasn't changed for 2.3 or 2.4).
> Now, classic classes are my habit and I see no compelling reason to
> put in the effort to change my habits.
Since the only effort is the addition of
__meta class__ = type
at the head of your modules you could probably automate this without
breaking too much code.
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
More information about the Python-list