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

Benjamin Kaplan benjamin.kaplan at case.edu
Mon Jun 20 21:33:38 EDT 2011


On Mon, Jun 20, 2011 at 6:26 PM, John Salerno <johnjsal 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.



More information about the Python-list mailing list