Ethan Furman
28cf663ff0
closes issue29167: fix race condition in (Int)Flag
2017-01-24 12:12:06 -08:00
Raymond Hettinger
381dc6c22f
Issue #29103 : Remove unused import. Noticed by Jean-Sebastien Bevilacqua.
2016-12-29 23:57:12 -07:00
Ethan Furman
23bb6f48ea
close issue28172: Change all example enum member names to uppercase, per Guido; patch by Chris Angelico.
2016-11-21 09:22:05 -08:00
Ethan Furman
3515dcce80
issue23591: fix flag decomposition and repr
2016-09-18 13:15:41 -07:00
Ethan Furman
06339e7493
Enum._convert: sort by value, then by name
2016-09-11 13:25:26 -07:00
Ethan Furman
c16595e567
issue23591: add auto() for auto-generating Enum member values
2016-09-10 23:36:59 -07:00
Ethan Furman
27682d2698
issue23591: more docs; slight change to repr
2016-09-04 11:39:01 -07:00
Ethan Furman
25d94bbf05
issue23591: bool(empty_flags) == False; more docs & tests
2016-09-02 16:32:32 -07:00
Ethan Furman
0443953067
issue23591: optimize _high_bit()
2016-09-02 15:50:21 -07:00
Ethan Furman
65a5a47d79
issue23591: add docs; code cleanup; more tests
2016-09-01 23:55:19 -07:00
Ethan Furman
ee47e5cf8a
issue23591: add Flags, IntFlags, and tests
2016-08-31 00:12:15 -07:00
Ethan Furman
e8e61277ff
issue26981: add _order_ compatibility shim to enum.Enum
2016-08-20 07:19:31 -07:00
Ethan Furman
332dbc7325
Issue26988: remove AutoEnum
2016-08-20 00:00:52 -07:00
Ethan Furman
73fc586d9f
Add AutoEnum: automatically provides next value if missing. Issue 26988.
2016-08-05 16:03:16 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)
6f20bd6063
signal, socket, and ssl module IntEnum constant name lookups now return a
...
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-06-03 19:14:52 +00:00
Ethan Furman
354706915c
issue26893: use mro() to examine class heirarchy
2016-05-01 10:04:21 -07:00
Ethan Furman
3803ad47bb
issue26893: use mro() to examine class heirarchy
2016-05-01 10:03:53 -07:00
Ethan Furman
0fe7978c68
Issue26748: Enum classes should evaluate as True
2016-04-13 23:55:40 -07:00
Ethan Furman
de4e079d3d
Issue26748: Enum classes should evaluate as True
2016-04-13 23:53:45 -07:00
Ethan Furman
5de67b106a
Issue26748: Enum classes should evaluate as True
2016-04-13 23:52:09 -07:00
Ethan Furman
60255b67b9
revert change 87a9dff5106c: pure Enum members again evaluate to True;
...
update Finer Points section of docs to cover boolean evaluation;
add more tests for pure and mixed boolean evaluation
2016-01-15 15:01:33 -08:00
Martin Panter
19e69c5a20
Issue #23883 : Add missing APIs to __all__; patch by Jacek Kołodziej
2015-11-14 12:46:42 +00:00
Ethan Furman
c791507e1f
Issue 25147: add reason for using _collections
2015-09-17 22:55:40 -07:00
Ethan Furman
e5754ab0c4
Close issue25147: use C implementation of OrderedDict
2015-09-17 22:03:52 -07:00
Ethan Furman
6db1fd5fb8
Close issue24840: Enum._value_ is queried for bool(); original patch by Mike Lundy
2015-09-17 21:49:12 -07:00
Ethan Furman
48a724fa33
Close issue23900: add default __doc__ to new enumerations that do not specify one.
2015-04-11 23:23:06 -07:00
Ethan Furman
24e837f231
issue23673
...
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-18 17:27:57 -07:00
Ethan Furman
354ecf1ef2
Close issue23486: performance boost for enum member lookup
2015-03-11 08:43:12 -07:00
Ethan Furman
ec5f8eb85f
Issue22506: remove name & value from __dir__ as they now show up automatically
2014-10-21 13:40:35 -07:00
Ethan Furman
987f3dd161
Issue22506: merge from 3.4
2014-10-14 08:59:14 -07:00
Ethan Furman
0ae550bdde
Issue22506: added methods on base Enum class now show up in dir of Enum subclass (3.4)
2014-10-14 08:58:32 -07:00
Ethan Furman
d9925a18ec
Close issue21706: add 'start' parameter to functional API
2014-09-16 20:35:55 -07:00
Ethan Furman
0081f23a08
consistently use _name_ and _value_; patch from Kiss Gyorgy
2014-09-16 17:31:23 -07:00
Ethan Furman
482fe0477e
issue23673
...
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-18 18:19:30 -07:00
Ethan Furman
2da950460d
Close issue20653: improve functional API docs; minor code changes
2014-03-03 12:42:52 -08:00
Ethan Furman
dc87052c0c
Close issue20653: allow Enum subclasses to override __reduce_ex__
2014-02-18 12:37:12 -08:00
Ethan Furman
ca1b794dac
Close issue20534: all pickle protocols now supported.
2014-02-08 11:36:27 -08:00
Ethan Furman
be3c2fea35
removed Enum.__eq__ as it added nothing
2013-11-13 14:25:45 -08:00
Ethan Furman
648f860c22
Close #19156 : add tests and fix for Enum helper edge cases. Patch from CliffM.
2013-10-06 17:19:54 -07:00
Ethan Furman
33918c128b
Issue19030: fixed comment that was still referring to a changed descriptor.
2013-09-27 23:02:02 -07:00
Ethan Furman
e03ea37a7b
Close #19030 : improvements to inspect and Enum.
...
inspect.getmembers and inspect.classify_class_attrs now search the metaclass
mro for types.DynamicClassAttributes (what use to be called
enum._RouteClassAttributeToGetattr); in part this means that these two
functions no longer rely solely on dir().
Besides now returning more accurate information, these improvements also
allow a more helpful help() on Enum classes.
2013-09-25 07:14:41 -07:00
Ethan Furman
64a9972b40
Close #19025 : Better error message when trying to delete an Enum member.
...
Also slight code reorg for PEP 8 guidelines.
2013-09-22 16:18:19 -07:00
Ethan Furman
c850f34220
Close #18693 : Enum is now more help() friendly.
2013-09-15 16:59:35 -07:00
Ethan Furman
101e0746d3
Close #18989 : enum members will no longer overwrite other attributes, nor be overwritten by them.
2013-09-15 12:34:36 -07:00
Ethan Furman
2131a4a2fc
Add __reversed__ to Enum. Minor code reorg (moved __members__ to be in alpha order).
2013-09-14 18:11:24 -07:00
Ethan Furman
f203f2d51d
Close #18924 : Block naive attempts to change an Enum member.
2013-09-06 07:16:48 -07:00
Ethan Furman
ec15a826ce
Close #18738 : Route __format__ calls to mixed-in type for mixed Enums (such as IntEnum).
2013-08-31 19:17:41 -07:00
Ezio Melotti
9a3777e525
#18705 : merge with 3.3.
2013-08-17 15:53:55 +03:00
Ethan Furman
388a3921cf
Issue 18693: Put custom __dir__ back in place. Will instead look at fixing `help()`.
2013-08-12 06:51:41 -07:00
Ethan Furman
53f58dbd12
Close #18693 : __dir__ removed from Enum; help() now helpful.
2013-08-10 13:07:49 -07:00