Skip to content

Commit 61f50bb

Browse files
committed
Issue22997: minor doc update; thanks to Simoen Visser
2 parents e62430e + 8a12329 commit 61f50bb

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Doc/library/enum.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ the ``start`` parameter to specify a different starting value). A
405405
new class derived from :class:`Enum` is returned. In other words, the above
406406
assignment to :class:`Animal` is equivalent to::
407407

408-
>>> class Animals(Enum):
408+
>>> class Animal(Enum):
409409
... ant = 1
410410
... bee = 2
411411
... cat = 3
@@ -422,7 +422,7 @@ enumeration is being created in (e.g. it will fail if you use a utility
422422
function in separate module, and also may not work on IronPython or Jython).
423423
The solution is to specify the module name explicitly as follows::
424424

425-
>>> Animals = Enum('Animals', 'ant bee cat dog', module=__name__)
425+
>>> Animal = Enum('Animal', 'ant bee cat dog', module=__name__)
426426

427427
.. warning::
428428

@@ -435,7 +435,7 @@ The new pickle protocol 4 also, in some circumstances, relies on
435435
to find the class. For example, if the class was made available in class
436436
SomeData in the global scope::
437437

438-
>>> Animals = Enum('Animals', 'ant bee cat dog', qualname='SomeData.Animals')
438+
>>> Animal = Enum('Animal', 'ant bee cat dog', qualname='SomeData.Animal')
439439

440440
The complete signature is::
441441

@@ -448,6 +448,10 @@ The complete signature is::
448448

449449
'red green blue' | 'red,green,blue' | 'red, green, blue'
450450

451+
or an iterator of names::
452+
453+
['red', 'green', 'blue']
454+
451455
or an iterator of (name, value) pairs::
452456

453457
[('cyan', 4), ('magenta', 5), ('yellow', 6)]

0 commit comments

Comments
 (0)