summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_enum.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22282)Ethan Furman2020-09-171-1/+18
| | | | | | | fix default `_missing_` to return `None` instead of raising a `ValueError` Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com> (cherry picked from commit c95ad7a91fbd7636f33a098d3b39964ab083bf49) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* _auto_called cleanup (GH-22285)Miss Islington (bot)2020-09-171-0/+11
| | | | | (cherry picked from commit fc23a9483ef0d7c98bea9f82392377d0b6ef7b18) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-41517: do not allow Enums to be extended (GH-22271)Miss Islington (bot)2020-09-161-0/+3
| | | | | | fix bug that let Enums be extended via multiple inheritance (cherry picked from commit 3064dbf5df1021e85b507366a7ea448c8895efe7) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)Ethan Furman2020-09-161-1/+8
| | | EnumMeta double-checks that `__repr__`, `__str__`, `__format__`, and `__reduce_ex__` are not the same as `object`'s, and replaces them if they are -- even if that replacement was intentionally done in the Enum being constructed. This patch fixes that.
* bpo-39587: Enum - use correct mixed-in data type (GH-22263) (GH-22266)Miss Islington (bot)2020-09-151-0/+43
| | | (cherry picked from commit bff01f3a3aac0c15fe8fbe8b2f561f7927d117a1)
* bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098)Ethan Onstott2020-04-281-0/+10
| | | require `_generate_next_value_` to be defined before members
* bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)Serhiy Storchaka2019-08-081-5/+3
|
* bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. ↵Walter Dörwald2019-07-181-6/+7
| | | | | (GH-14809) * Use __qualname__ instead of __name__ in enum exception messages.
* bpo-37479: on Enum subclasses with mixins, __format__ uses overridden ↵thatneat2019-07-041-1/+52
| | | | | __str__ (GH-14545) * bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__
* bpo-36401: Have help() show readonly properties separately (GH-12517)Raymond Hettinger2019-03-251-1/+1
|
* bpo-35899: Fix Enum handling of empty and weird strings (GH-11891)Brennan D Baraban2019-03-031-0/+17
| | | | | | | | | | Co-authored-by: Maxwell <maxwellpxt@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> https://bugs.python.org/issue35899
* bpo-35717: Fix KeyError exception raised when using enums and compile (GH-11523)Rémi Lapeyre2019-01-241-0/+9
| | | https://bugs.python.org/issue17467
* bpo-34536: Cleanup test_enum imports (GH-9979)Victor Stinner2018-10-191-5/+0
| | | sys and threading were imported twice.
* bpo-34909: keep searching mixins until base class is found (GH-9737)Ethan Furman2018-10-061-0/+21
|
* bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328)Ethan Furman2018-09-221-0/+199
| | | * bpo-29577: allow multiple mixin classes
* bpo-34536: raise error for invalid _missing_ results (GH-9147)Ethan Furman2018-09-121-0/+33
| | | * raise exception if _missing_ returns None or invalid type
* bpo-34282: Fix Enum._convert shadowing members named _convert (GH-8568)orlnub1232018-09-121-2/+38
| | | | | * Fix enum members getting shadowed by parent attributes * Move Enum._convert to EnumMeta._convert_ * Deprecate _convert
* bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)Rahul Jha2018-09-101-3/+52
| | | * bpo-33217: Raise TypeError for non-Enum lookups in Enums
* bpo-31801: Enum: add _ignore_ as class option (#5237)Ethan Furman2018-01-221-0/+33
| | | | | | | | | | | | | | | | * 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_
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-6/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30616: Functional API of enum allows to create empty enums. (#2304)Dong-hee Na2017-06-211-0/+20
| | | | | | | | * bpo-30616: Functional API of enum allows to create empty enums. * Update NEWS move addition to avoid conflict
* issue29167: fix race condition in (Int)FlagEthan Furman2017-01-241-2/+88
|\
| * closes issue29167: fix race condition in (Int)FlagEthan Furman2017-01-241-2/+88
| |
* | Issue #29338: Fix test_enum.Serhiy Storchaka2017-01-241-0/+4
|/
* close issue28172: Change all example enum member names to uppercase, per ↵Ethan Furman2016-11-211-3/+3
| | | | Guido; patch by Chris Angelico.
* issue23591: fix flag decomposition and reprEthan Furman2016-09-181-28/+77
|
* issue23591: add auto() for auto-generating Enum member valuesEthan Furman2016-09-111-2/+75
|
* issue23591: more docs; slight change to reprEthan Furman2016-09-041-6/+6
|
* issue23591: bool(empty_flags) == False; more docs & testsEthan Furman2016-09-021-0/+16
|
* issue23591: add docs; code cleanup; more testsEthan Furman2016-09-021-17/+71
|
* issue23591: add Flags, IntFlags, and testsEthan Furman2016-08-311-1/+451
|
* issue26981: add _order_ compatibility shim to enum.EnumEthan Furman2016-08-201-0/+62
|
* Issue26988: remove AutoEnumEthan Furman2016-08-201-323/+1
|
* Add AutoEnum: automatically provides next value if missing. Issue 26988.Ethan Furman2016-08-051-1/+323
|
* Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-10/+10
|\
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-10/+10
| | | | | | | | Based on patch by Ville Skyttä.
* | signal, socket, and ssl module IntEnum constant name lookups now return aGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-0/+36
| | | | | | | | | | | | | | | | 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.
* | Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-0/+12
|\ \ | |/
| * Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-0/+12
| |
* | issue26893: use mro() to examine class heirarchyEthan Furman2016-05-011-0/+13
|\ \ | |/
| * issue26893: use mro() to examine class heirarchyEthan Furman2016-05-011-0/+13
| |
* | Issue26748: Enum classes should evaluate as TrueEthan Furman2016-04-141-0/+13
|\ \ | |/
| * Issue26748: Enum classes should evaluate as TrueEthan Furman2016-04-141-0/+13
| |\
| | * Issue26748: Enum classes should evaluate as TrueEthan Furman2016-04-141-0/+13
| | |
| | * issue23673Ethan Furman2015-03-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | revert change 87a9dff5106c: pure Enum members again evaluate to True;Ethan Furman2016-01-151-1/+16
| | | | | | | | | | | | | | | update Finer Points section of docs to cover boolean evaluation; add more tests for pure and mixed boolean evaluation
* | | Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter2015-11-141-0/+7
| | |
* | | Close issue24840: Enum._value_ is queried for bool(); original patch by Mike ↵Ethan Furman2015-09-181-0/+7
|/ / | | | | | | Lundy
* | Close issue23900: add default __doc__ to new enumerations that do not ↵Ethan Furman2015-04-121-5/+5
| | | | | | | | specify one.
* | Issue23826: fix doc test for -OO runsEthan Furman2015-04-111-4/+35
| |