Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8a123292
Commit
8a123292
authored
Jan 14, 2015
by
Ethan Furman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue22997: minor doc update; thanks to Simoen Visser
parent
2f825af7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Doc/library/enum.rst
Doc/library/enum.rst
+7
-3
No files found.
Doc/library/enum.rst
View file @
8a123292
...
...
@@ -404,7 +404,7 @@ enumerations; the others auto-assign increasing integers starting with 1. A
new class derived from :class:`Enum` is returned. In other words, the above
assignment to :class:`Animal` is equivalent to::
>>> class Animal
s
(Enum):
>>> class Animal(Enum):
... ant = 1
... bee = 2
... cat = 3
...
...
@@ -421,7 +421,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::
>>> Animal
s = Enum('Animals
', 'ant bee cat dog', module=__name__)
>>> Animal
= Enum('Animal
', 'ant bee cat dog', module=__name__)
.. warning::
...
...
@@ -434,7 +434,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::
>>> Animal
s = Enum('Animals', 'ant bee cat dog', qualname='SomeData.Animals
')
>>> Animal
= Enum('Animal', 'ant bee cat dog', qualname='SomeData.Animal
')
The complete signature is::
...
...
@@ -447,6 +447,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)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment