On Tue, 8 Jun 2010 01:12:28 am pyt...@bdurham.com wrote:
> Not the OP, but I was surprised to see class Name() work (in Python
> 2.6.5 at least).
>
> Is this equivalent to class Name( object ) or does this create an old
> style class?

In Python 2.x, all classes are old-style unless you directly or 
indirectly inherit from object. If you inherit from nothing, it is an 
old-style class regardless of whether you say 

class Name: pass

or 

class Name(): pass

In Python 3.x, there are no old-style classes.

> Going forward into the 2.7/3.x world, is there a preferred style?

No.



-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to