diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-22 03:18:24 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-22 03:18:24 (GMT) |
commit | da825ab2ddf7d8c7a4c6672c75a2ea907af8dfe9 (patch) | |
tree | c404bcf71592add5ce026f2267607ca24446b00c /Doc/reference/compound_stmts.rst | |
parent | f213d2317cc167263bb8599e599bddc5537fed1a (diff) | |
download | cpython-da825ab2ddf7d8c7a4c6672c75a2ea907af8dfe9.zip cpython-da825ab2ddf7d8c7a4c6672c75a2ea907af8dfe9.tar.gz cpython-da825ab2ddf7d8c7a4c6672c75a2ea907af8dfe9.tar.bz2 |
Merged revisions 86670 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86670 | eric.araujo | 2010-11-22 04:09:19 +0100 (lun., 22 nov. 2010) | 5 lines
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 5582cf6..f5d919a 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -560,7 +560,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. |