diff options
author | Georg Brandl <georg@python.org> | 2014-10-31 09:39:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-31 09:39:29 (GMT) |
commit | e21a531ef10e120a94434b3d4806a8106dd6f271 (patch) | |
tree | 0b1d0245388effa5cbf130744b50af6ab6a1eb5f /Doc/library/collections.rst | |
parent | fe98180bced16be7d62b762cc85d400f929d0885 (diff) | |
parent | a4c8c47961305487ef6c40a6d882bb956f2c5a0b (diff) | |
download | cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.zip cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.tar.gz cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.tar.bz2 |
merge with 3.4
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 75053a5..c21f456 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -908,7 +908,7 @@ customize a prototype instance: >>> 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` : +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 @@ -917,6 +917,9 @@ and more efficient to use a simple :class:`~enum.Enum` : >>> class Status(Enum): ... open, pending, closed = range(3) + +.. seealso:: + * `Recipe for named tuple abstract base class with a metaclass mix-in <http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/>`_ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for |