diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-22 03:09:19 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-22 03:09:19 (GMT) |
commit | 28053fb174cd548629b8c94cba02ce837aeb9e5b (patch) | |
tree | b5450a4b4e121f3a9b649aa4f6e00a4dcbde88bf /Doc/reference/compound_stmts.rst | |
parent | d4bbab278fc5021f5adbf4ae336e2754ca2037b3 (diff) | |
download | cpython-28053fb174cd548629b8c94cba02ce837aeb9e5b.zip cpython-28053fb174cd548629b8c94cba02ce837aeb9e5b.tar.gz cpython-28053fb174cd548629b8c94cba02ce837aeb9e5b.tar.bz2 |
Remove unnecessary `object` base class in docs (#10366).
Also add a note about inheritance from `object` being default.
Diffstat (limited to 'Doc/reference/compound_stmts.rst')
-rw-r--r-- | Doc/reference/compound_stmts.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 95d5705..1622133 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -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. |