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/library/functions.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/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 764fd8f..af005b3 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -256,7 +256,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"] ... @@ -864,7 +864,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 @@ -883,7 +883,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 @@ -900,7 +900,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 @@ -1200,7 +1200,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)) |