Initializing an attribute that needs the object

John Machin sjmachin at lexicon.net
Fri Jun 2 19:40:55 EDT 2006


On 3/06/2006 9:17 AM, David Pratt **TOPPOSTED**:
> Hi Bruno. This is certainly what I was missing. Thank you. I am afraid I 
> am behind the times with use of object. Will I only use object when I am 
> not subclassing? 

More precisely, don't use object when you are subclassing.

> Where will I find a document that provides info on the 
> use of object in new style classes?
> 

Other way up :-)
A new-style class is one which inherits ultimately from the type that is 
called "object".

class NewStyleClass(object):
     pass

class OldStyleClass():
     pass

Docs are a bit ummmm ...
See this: http://www.python.org/doc/newstyle/

HTH,
John




More information about the Python-list mailing list