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.
........
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 652a2f4..c822e7d 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -369,7 +369,7 @@
:attr:`_as_parameter_` attribute and uses this as the function argument. Of
course, it must be one of integer, string, or bytes::
- >>> class Bottles(object):
+ >>> class Bottles:
... def __init__(self, number):
... self._as_parameter_ = number
...
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 @@
['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 @@
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 @@
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 @@
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 @@
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))
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 9b2aa40..b4854c6 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -323,7 +323,7 @@
:func:`groupby` is equivalent to::
- class groupby(object):
+ class groupby:
# [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
# [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D
def __init__(self, iterable, key=None):
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index a3fd970..9fa2d81 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1318,7 +1318,7 @@
from multiprocessing.managers import BaseManager
- class MathsClass(object):
+ class MathsClass:
def add(self, x, y):
return x + y
def mul(self, x, y):
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index ae15786..b76f6eb 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -682,7 +682,7 @@
This is a good approach if you write the class yourself. Let's suppose you have
a class like this::
- class Point(object):
+ class Point:
def __init__(self, x, y):
self.x, self.y = x, y