Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5826

Re: Inheriting Object

References <BANLkTin00aw0e0yxjPgYyb-QvtsNbLt9wg@mail.gmail.com> <4DD5D831.4020308@mrabarnett.plus.com> <BANLkTimJn_1deuhTnK4DDo+bvQKT05BPSw@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-05-20 00:53 -0600
Subject Re: Inheriting Object
Newsgroups comp.lang.python
Message-ID <mailman.1827.1305874469.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, May 19, 2011 at 10:11 PM, Navkirat Singh <n4vpython@gmail.com> wrote:
> Thanks Guys...I will look deeper into this. I thought I read somewhere that
> it was required in older python releases, but in newer releases it is not. I
> might be wrong though.

In Python 3.x all classes inherit from object by default, so "class
Foo(object):" and "class Foo:" are equivalent.  In Python 2.x they are
not equivalent, and you should use "class Foo(object):" unless you
have a specific reason not to.

Cheers,
Ian

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Inheriting Object Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-20 00:53 -0600

csiph-web