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

looping kadeko at gmail.com
Tue Apr 11 06:49:13 EDT 2006


For Python developers around.

>From Python 2.5 doc:
The list of base classes in a class definition can now be empty. As an
example, this is now legal:
  class C():
      pass

nice but why this syntax return old-style class, same as "class C:",
and not the new style "class C(object):" ?
Old-style class are somewhat deprecated and could be almost always be
replaced by new-style class, so this syntax could be a nice shortcut to
create them.

Am I wrong or is there something that I've missed ?




More information about the Python-list mailing list