[Python-checkins] cpython (merge 3.4 -> default): Issue22997: minor doc update; thanks to Simoen Visser

ethan.furman python-checkins at python.org
Thu Jan 15 07:32:54 CET 2015


https://hg.python.org/cpython/rev/31ae2dcaaed8
changeset:   94156:31ae2dcaaed8
parent:      94154:55ba19d084fb
parent:      94155:522d13d8e76e
user:        Ethan Furman <ethan at stoneleaf.us>
date:        Wed Jan 14 22:32:29 2015 -0800
summary:
  Issue22997: minor doc update; thanks to Simoen Visser

files:
  Doc/library/enum.rst |  10 +++++++---
  1 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -405,7 +405,7 @@
 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 @@
 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 @@
 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 @@
 
     '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)]

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list