summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-11-10 08:00:00 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-11-10 08:00:00 (GMT)
commit549e34cc7bb5af347512c9feae1b917f5fb65479 (patch)
tree80a2d66d86bae121036ebbe0fe27a14972421bae
parent4f1c1879cb1e4e1aa398cc994c2de534bb2d0e53 (diff)
downloadcpython-549e34cc7bb5af347512c9feae1b917f5fb65479.zip
cpython-549e34cc7bb5af347512c9feae1b917f5fb65479.tar.gz
cpython-549e34cc7bb5af347512c9feae1b917f5fb65479.tar.bz2
Remove confusing section from named tuple recipes.
-rw-r--r--Doc/library/collections.rst10
1 files changed, 0 insertions, 10 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 8ab7571..8841db6 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -942,16 +942,6 @@ customize a prototype instance:
>>> johns_account = default_account._replace(owner='John')
>>> janes_account = default_account._replace(owner='Jane')
-Enumerated constants can be implemented with named tuples, but it is simpler
-and more efficient to use a simple :class:`~enum.Enum`:
-
- >>> Status = namedtuple('Status', 'open pending closed')._make(range(3))
- >>> Status.open, Status.pending, Status.closed
- (0, 1, 2)
- >>> from enum import Enum
- >>> class Status(Enum):
- ... open, pending, closed = range(3)
-
.. seealso::