summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2015-01-15 06:32:29 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2015-01-15 06:32:29 (GMT)
commit61f50bb488dc8cc3560ee7b91d244bd2ae96507a (patch)
treebba9b343fdc2a7af47017a53da470e433f43fd96 /Doc
parente62430eda49f7024d66b270023d755e80d7ff1c1 (diff)
parent8a123292818a88d334068249792539dab0656f4d (diff)
downloadcpython-61f50bb488dc8cc3560ee7b91d244bd2ae96507a.zip
cpython-61f50bb488dc8cc3560ee7b91d244bd2ae96507a.tar.gz
cpython-61f50bb488dc8cc3560ee7b91d244bd2ae96507a.tar.bz2
Issue22997: minor doc update; thanks to Simoen Visser
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/enum.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index f75c43c..d3b838c 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -405,7 +405,7 @@ the ``start`` parameter to specify a different starting value). A
new class derived from :class:`Enum` is returned. In other words, the above
assignment to :class:`Animal` is equivalent to::
- >>> class Animals(Enum):
+ >>> class Animal(Enum):
... ant = 1
... bee = 2
... cat = 3
@@ -422,7 +422,7 @@ enumeration is being created in (e.g. it will fail if you use a utility
function in separate module, and also may not work on IronPython or Jython).
The solution is to specify the module name explicitly as follows::
- >>> Animals = Enum('Animals', 'ant bee cat dog', module=__name__)
+ >>> Animal = Enum('Animal', 'ant bee cat dog', module=__name__)
.. warning::
@@ -435,7 +435,7 @@ The new pickle protocol 4 also, in some circumstances, relies on
to find the class. For example, if the class was made available in class
SomeData in the global scope::
- >>> Animals = Enum('Animals', 'ant bee cat dog', qualname='SomeData.Animals')
+ >>> Animal = Enum('Animal', 'ant bee cat dog', qualname='SomeData.Animal')
The complete signature is::
@@ -448,6 +448,10 @@ The complete signature is::
'red green blue' | 'red,green,blue' | 'red, green, blue'
+ or an iterator of names::
+
+ ['red', 'green', 'blue']
+
or an iterator of (name, value) pairs::
[('cyan', 4), ('magenta', 5), ('yellow', 6)]