Remove unnecessary object base class in docs (#10366).

Also add a note about inheritance from `object` being default.
This commit is contained in:
Éric Araujo 2010-11-22 03:09:19 +00:00
parent d4bbab278f
commit 28053fb174
13 changed files with 26 additions and 17 deletions

View file

@ -561,7 +561,16 @@ A class definition defines a class object (see section :ref:`types`):
A class definition is an executable statement. The inheritance list usually
gives a list of base classes (see :ref:`metaclasses` for more advanced uses), so
each item in the list should evaluate to a class object which allows
subclassing.
subclassing. Classes without an inheritance list inherit, by default, from the
base class :class:`object`; hence, ::
class Foo:
pass
is equivalent to ::
class Foo(object):
pass
The class's suite is then executed in a new execution frame (see :ref:`naming`),
using a newly created local namespace and the original global namespace.

View file

@ -1987,7 +1987,7 @@ to work correctly if defined on an object's type, not in the object's instance
dictionary. That behaviour is the reason why the following code raises an
exception::
>>> class C(object):
>>> class C:
... pass
...
>>> c = C()