On 06/20/2013 01:27 PM, Guido van Rossum wrote:
On Thu, Jun 20, 2013 at 1:18 PM, Amaury Forgeot d'Arc wrote:
2013/6/20 Serhiy Storchaka wrote:
Now with enumerations in the stdlib the stat module constants are
candidates for flag enumerations. How easy will be implement it on C?
Aha. Should an internal C module fetch the value of the constants, and a
public stat.py nicely wrap them in enums?
But aren't most of these masks? enum.IntEnum doesn't handle those very
gracefully (the | operator returns a plain int).
As is, IntEnum would not be a great choice.
We could either add a another Enum (BitMaskEnum?) that was also int-based, or flesh out IntEnum with enough smarts to
handle |, &, and ^ and return an IntEnum when possible and fall back to a plain int when not possible.
--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com