diff -r a22ef88143b9 Doc/library/collections.rst --- a/Doc/library/collections.rst Sat Oct 25 23:05:21 2014 -0500 +++ b/Doc/library/collections.rst Tue Oct 28 13:33:14 2014 +0200 @@ -908,12 +908,13 @@ >>> 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 declaration: +and more efficient to use a simple :class:`Enum`: >>> Status = namedtuple('Status', 'open pending closed')._make(range(3)) >>> Status.open, Status.pending, Status.closed (0, 1, 2) - >>> class Status: + >>> from enum import Enum + >>> class Status(Enum): open, pending, closed = range(3) * `Recipe for named tuple abstract base class with a metaclass mix-in