Inherting from object. Or not.

Lee Harr lee at example.com
Wed Jan 26 16:26:09 EST 2005


> What is the difference between inherting form object, and not doing it? E.g, 
> what's the difference between the two following classes?
>
> class foo:
> 	pass
>
> class bar(object):
> 	pass
>
> Sometimes people inherit from it, and sometimes not. I don't see a pattern in 
> their choices.
>
>


I think this is the best source:
http://www.python.org/2.2.3/descrintro.html

Subclassing object gets you a "new style" class and some
additional capabilities. Maybe eventually it will not
matter.



More information about the Python-list mailing list