diff options
author | Raymond Hettinger <python@rcn.com> | 2008-01-15 21:22:47 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-01-15 21:22:47 (GMT) |
commit | e805782b537cce4a1cf1d15b554b0895dc67123a (patch) | |
tree | 902bda1037896bfe43b9642a0eaf840c21ace575 | |
parent | f59e962b494905796d5f0e74e7a97274c04ff19f (diff) | |
download | cpython-e805782b537cce4a1cf1d15b554b0895dc67123a.zip cpython-e805782b537cce4a1cf1d15b554b0895dc67123a.tar.gz cpython-e805782b537cce4a1cf1d15b554b0895dc67123a.tar.bz2 |
Fix-up half-written paragraph in the docs
-rw-r--r-- | Doc/library/collections.rst | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index de9bcbf..cde114c 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -535,13 +535,9 @@ faster versions that bypass error-checking:: def _replace(self, _map=map, **kwds): return self._make(_map(kwds.get, ('x', 'y'), self)) -Note, subclasses should set ``__slots__`` to an empty tuple so that -an instance dictionary will not be created and the memory overhead -will be kept to zero. - -Note, subclasses should set ``__slots__`` to an empty tuple. This -reduces memory usage by - +The subclasses shown above set ``__slots__`` to an empty tuple. This keeps +the named tuples from having per-instance dictionaries, so they will +continue to be lightweight and require no more memory than regular tuples. Subclassing is not useful for adding new, stored fields. Instead, simply create a new named tuple type from the :attr:`_fields` attribute:: |