summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
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)
commit28053fb174cd548629b8c94cba02ce837aeb9e5b (patch)
treeb5450a4b4e121f3a9b649aa4f6e00a4dcbde88bf /Doc/library/functions.rst
parentd4bbab278fc5021f5adbf4ae336e2754ca2037b3 (diff)
downloadcpython-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/library/functions.rst')
-rw-r--r--Doc/library/functions.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 61bf391..ec01d69 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -259,7 +259,7 @@ are always available. They are listed here in alphabetical order.
['Struct', '__builtins__', '__doc__', '__file__', '__name__',
'__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
'unpack', 'unpack_from']
- >>> class Foo(object):
+ >>> class Foo:
... def __dir__(self):
... return ["kan", "ga", "roo"]
...
@@ -903,7 +903,7 @@ are always available. They are listed here in alphabetical order.
function for setting, and *fdel* a function for del'ing, an attribute. Typical
use is to define a managed attribute ``x``::
- class C(object):
+ class C:
def __init__(self):
self._x = None
@@ -922,7 +922,7 @@ are always available. They are listed here in alphabetical order.
property will copy *fget*'s docstring (if it exists). This makes it possible to
create read-only properties easily using :func:`property` as a :term:`decorator`::
- class Parrot(object):
+ class Parrot:
def __init__(self):
self._voltage = 100000
@@ -939,7 +939,7 @@ are always available. They are listed here in alphabetical order.
corresponding accessor function set to the decorated function. This is
best explained with an example::
- class C(object):
+ class C:
def __init__(self):
self._x = None
@@ -1243,7 +1243,7 @@ are always available. They are listed here in alphabetical order.
attribute. For example, the following two statements create identical
:class:`type` objects:
- >>> class X(object):
+ >>> class X:
... a = 1
...
>>> X = type('X', (object,), dict(a=1))