summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-27 10:47:55 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-27 10:47:55 (GMT)
commit9bba7b70852bc0aff6abafcafe46c25c19eb8f81 (patch)
tree49cd834e480614b2ececd2f00a9c6856c033b89a
parent63c77b61751c2d15754b6381d085eb5ca2e26501 (diff)
downloadcpython-9bba7b70852bc0aff6abafcafe46c25c19eb8f81.zip
cpython-9bba7b70852bc0aff6abafcafe46c25c19eb8f81.tar.gz
cpython-9bba7b70852bc0aff6abafcafe46c25c19eb8f81.tar.bz2
Removed an unnecessary and confusing paragraph from the namedtuple docs.
-rw-r--r--Doc/library/collections.rst11
1 files changed, 1 insertions, 10 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index a891aff..58449fe 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -526,16 +526,7 @@ a fixed-width print format::
Point: x= 3.000 y= 4.000 hypot= 5.000
Point: x=14.000 y= 0.714 hypot=14.018
-Another use for subclassing is to replace performance critcal methods with
-faster versions that bypass error-checking::
-
- class Point(namedtuple('Point', 'x y')):
- __slots__ = ()
- _make = classmethod(tuple.__new__)
- def _replace(self, _map=map, **kwds):
- return self._make(_map(kwds.get, ('x', 'y'), self))
-
-The subclasses shown above set ``__slots__`` to an empty tuple. This keeps
+The subclass shown above sets ``__slots__`` to an empty tuple. This keeps
keep memory requirements low by preventing the creation of instance dictionaries.
Subclassing is not useful for adding new, stored fields. Instead, simply