On Mon, Jul 13, 2009 at 2:51 PM, Vilya Harvey<vilya.har...@gmail.com> wrote: > 2009/7/13 Aaron Scott <aaron.hildebra...@gmail.com>: >>> BTW, you should derive all your classes from something. If nothing >>> else, use object. >>> class textfile(object): >> >> Just out of curiousity... why is that? I've been coding in Python for >> a long time, and I never derive my base classes. What's the advantage >> to deriving them? > > class Foo: > > uses the old object model. > > class Foo(object): > > uses the new object model. > > See http://docs.python.org/reference/datamodel.html (specifically > section 3.3) for details of the differences.
Note that Python 3.0 makes explicitly subclassing `object` unnecessary since it removes old-style classes; a class that doesn't explicitly subclass anything will implicitly subclass `object`. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list