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

Peter Hansen peter at engcorp.com
Tue Apr 11 08:39:25 EDT 2006


looping wrote:
> But I think that if we make "class C():" a synonym of "class
> C(object):", it will save lot of keystrokes ;-)

Saving keystrokes has only rarely influenced Python's design, 
thankfully.  If you read "import this", you'll see "explicit is better 
than implicit", and interpreting in this case one would have to say that 
  so long as both old and new-style classes exist, making "class():" 
equivalent to "class(object):" would be doing something very implicit, 
and potentially very confusing.  Leaving things just as they are would 
be a better choice.

-Peter




More information about the Python-list mailing list