[Python-checkins] r59988 - python/trunk/Doc/library/collections.rst
raymond.hettinger
python-checkins at python.org
Tue Jan 15 22:22:47 CET 2008
Author: raymond.hettinger
Date: Tue Jan 15 22:22:47 2008
New Revision: 59988
Modified:
python/trunk/Doc/library/collections.rst
Log:
Fix-up half-written paragraph in the docs
Modified: python/trunk/Doc/library/collections.rst
==============================================================================
--- python/trunk/Doc/library/collections.rst (original)
+++ python/trunk/Doc/library/collections.rst Tue Jan 15 22:22:47 2008
@@ -535,13 +535,9 @@
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::
More information about the Python-checkins
mailing list