L
looping
For Python developers around.
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 ?
The list of base classes in a class definition can now be empty. As anFrom Python 2.5 doc:
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 ?