summaryrefslogtreecommitdiff
path: root/Lib/enum.py
AgeCommit message (Collapse)AuthorLines
2020-06-11bpo-40025: Require _generate_next_value_ to be defined before members (GH-19762)Miss Islington (bot)-0/+5
require `_generate_next_value_` to be defined before members (cherry picked from commit d9a43e20facdf4ad10186f820601c6580e1baa80)
2019-09-20Doc: Fix spelling errors of 'initial' in enum.py (GH-16314)Miss Islington (bot)-1/+1
(cherry picked from commit bb16fb2cb8dca1fa1d67621c3175793eda7dbdc2) Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2019-03-08bpo-35899: Fix Enum handling of empty and weird strings (GH-11891)Miss Islington (bot)-8/+9
Co-authored-by: Maxwell <maxwellpxt@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> https://bugs.python.org/issue35899 (cherry picked from commit 8b914d2767acba3a9e78f1dacdc2d61dbfd7e304) Co-authored-by: Brennan D Baraban <34765317+bdbaraban@users.noreply.github.com>
2019-01-30bpo-35717: Fix KeyError exception raised when using enums and compile ↵Miss Islington (bot)-1/+1
(GH-11523) (GH-11669) https://bugs.python.org/issue17467 (cherry picked from commit 1fd06f1eca80dcbf3a916133919482a8327f3da4) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2018-12-26Speed-up building enums by value, e.g. http.HTTPStatus(200) (GH-11318) ↵Miss Islington (bot)-2/+4
(GH-11324) bpo-35585: Speed up enum by-value lookup (cherry picked from commit 34ae04f74dcf4ac97d07c3e82eaf8f619d80cedb) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-10-19bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978)Victor Stinner-1/+19
* raise exception if _missing_ returns None or invalid type
2018-10-06bpo-34909: keep searching mixins until base class is found (GH-9737) (GH-9738)Miss Islington (bot)-3/+1
(cherry picked from commit cd45385ffad8910293e5659cfe7ab036e70613b7)
2018-09-21[3.7] bpo-29577: Enum: mixin classes don't mix well with already mixed Enums ↵Ethan Furman-30/+18
(GH-9328) (GH-9486) * bpo-29577: allow multiple mixin classes
2018-09-10[3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert ↵orlnub123-4/+6
(GH-9034) * Fix Enum._convert shadowing members named _convert
2018-04-16bpo-31947: remove None default for names param in Enum._create_ (GH-4288)Miss Islington (bot)-1/+1
(cherry picked from commit b8e21f12891382bc0aac5ccd13dcb4a990d65e0a) Co-authored-by: anentropic <ego@anentropic.com>
2018-04-11[3.7] bpo-33217: deprecate non-Enum lookups in Enums (GH-6392)Ethan Furman-1/+12
deprecate non-Enum lookups in Enums Lookups such as `1 in Color` and `2 in SomeFlag()` will raise TypeError in 3.8+.
2018-01-22bpo-31801: Enum: add _ignore_ as class option (#5237)Ethan Furman-1/+19
* bpo-31801: Enum: add _ignore_ as class option _ignore_ is a list, or white-space seperated str, of names that will not be candidates for members; these names, and _ignore_ itself, are removed from the final class. * bpo-31801: Enum: add documentation for _ignore_ * bpo-31801: Enum: remove trailing whitespace * bpo-31801: Enum: fix bulleted list format * bpo-31801: add version added for _ignore_
2017-09-26bpo-30152: Reduce the number of imports for argparse. (#1269)Serhiy Storchaka-7/+4
2017-08-03Spelling fixes (#2902)Ville Skyttä-1/+1
2017-06-21bpo-30616: Functional API of enum allows to create empty enums. (#2304)Dong-hee Na-1/+1
* bpo-30616: Functional API of enum allows to create empty enums. * Update NEWS move addition to avoid conflict
2017-01-24closes issue29167: fix race condition in (Int)FlagEthan Furman-4/+11
2016-12-29Issue #29103: Remove unused import. Noticed by Jean-Sebastien Bevilacqua.Raymond Hettinger-1/+1
2016-11-21close issue28172: Change all example enum member names to uppercase, per ↵Ethan Furman-2/+2
Guido; patch by Chris Angelico.
2016-09-18issue23591: fix flag decomposition and reprEthan Furman-58/+94
2016-09-11Enum._convert: sort by value, then by nameEthan Furman-3/+10
2016-09-10issue23591: add auto() for auto-generating Enum member valuesEthan Furman-13/+37
2016-09-04issue23591: more docs; slight change to reprEthan Furman-8/+5
2016-09-02issue23591: bool(empty_flags) == False; more docs & testsEthan Furman-0/+3
2016-09-02issue23591: optimize _high_bit()Ethan Furman-7/+2
2016-09-01issue23591: add docs; code cleanup; more testsEthan Furman-4/+4
2016-08-31issue23591: add Flags, IntFlags, and testsEthan Furman-10/+217
2016-08-20issue26981: add _order_ compatibility shim to enum.EnumEthan Furman-2/+15
2016-08-20Issue26988: remove AutoEnumEthan Furman-121/+12
2016-08-05Add AutoEnum: automatically provides next value if missing. Issue 26988.Ethan Furman-12/+121
2016-06-03signal, socket, and ssl module IntEnum constant name lookups now return aGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)-2/+8
consistent name for values having multiple names. Ex: signal.Signals(6) now refers to itself as signal.SIGALRM rather than flipping between that and signal.SIGIOT based on the interpreter's hash randomization seed. This helps finish issue27167.
2016-05-01issue26893: use mro() to examine class heirarchyEthan Furman-1/+1
2016-05-01issue26893: use mro() to examine class heirarchyEthan Furman-1/+1
2016-04-13Issue26748: Enum classes should evaluate as TrueEthan Furman-0/+6
2016-04-13Issue26748: Enum classes should evaluate as TrueEthan Furman-0/+6
2016-04-13Issue26748: Enum classes should evaluate as TrueEthan Furman-0/+6
2016-01-15revert change 87a9dff5106c: pure Enum members again evaluate to True;Ethan Furman-3/+0
update Finer Points section of docs to cover boolean evaluation; add more tests for pure and mixed boolean evaluation
2015-11-14Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter-1/+1
2015-09-17Issue 25147: add reason for using _collectionsEthan Furman-0/+1
2015-09-17Close issue25147: use C implementation of OrderedDictEthan Furman-1/+6
2015-09-17Close issue24840: Enum._value_ is queried for bool(); original patch by Mike ↵Ethan Furman-0/+3
Lundy
2015-04-11Close issue23900: add default __doc__ to new enumerations that do not ↵Ethan Furman-0/+4
specify one.
2015-03-18issue23673Ethan Furman-0/+26
add private method to enum to support replacing global constants with Enum members: - search for candidate constants via supplied filter - create new enum class and members - insert enum class and replace constants with members via supplied module name - replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle modify IntEnum classes to use new method
2015-03-11Close issue23486: performance boost for enum member lookupEthan Furman-1/+10
2014-10-21Issue22506: remove name & value from __dir__ as they now show up automaticallyEthan Furman-2/+1
2014-10-14Issue22506: merge from 3.4Ethan Furman-1/+6
2014-10-14Issue22506: added methods on base Enum class now show up in dir of Enum ↵Ethan Furman-1/+6
subclass (3.4)
2014-09-16Close issue21706: add 'start' parameter to functional APIEthan Furman-8/+8
2014-09-16consistently use _name_ and _value_; patch from Kiss GyorgyEthan Furman-5/+5
2015-03-18issue23673Ethan Furman-0/+26
add private method to enum to support replacing global constants with Enum members: - search for candidate constants via supplied filter - create new enum class and members - insert enum class and replace constants with members via supplied module name - replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle modify IntEnum classes to use new method
2014-03-03Close issue20653: improve functional API docs; minor code changesEthan Furman-12/+27