Do we still need to inherit from "object" to create new-style classes?

John Salerno johnjsal at gmail.com
Mon Jun 20 22:13:51 EDT 2011


On Jun 20, 8:33 pm, Benjamin Kaplan <benjamin.kap... at case.edu> wrote:
> On Mon, Jun 20, 2011 at 6:26 PM, John Salerno <johnj... at gmail.com> wrote:
> > I can't quite seem to find the answer to this anywhere. The book I'm
> > reading right now was written for Python 3.1 and doesn't use (object),
> > so I'm thinking that was just a way to force new-style classes in 2.x
> > and is no longer necessary in 3.x. Is that right?
>
> > (The documentation doesn't mention object anymore, but elsewhere on
> > the Python website it says the documentation hasn't been updated for
> > new-style classes yet, hence my confusion.)
>
> > Thanks.
>
> 3.x got rid of old-style classes altogether, so you are correct-
> there's no need to explicitly subclass object.

Thanks! And apologies for having to start a thread to ask just that! :)



More information about the Python-list mailing list