why are people still using classic classes?

Michael Hobbs mike at hobbshouse.org
Thu Jan 13 12:21:30 EST 2005


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
> standard library.
> 
> 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
> new-style classes?

I'm guessing that the biggest contributor to the continued prevalence
of classic classes is the official Python Tutorial:
    http://docs.python.org/tut/node11.html#SECTION0011300000000000000000

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.

Regards,
- Mike







More information about the Python-list mailing list