Irit Katriel <[email protected]> added the comment:
I believe this is what Rahul means:
import enum
class Color(enum.Flag):
RED = enum.auto()
BLUE = enum.auto()
GREEN = enum.auto()
white = Color.RED | Color.BLUE | Color.GREEN
assert white.name is None
# Note, however that:
assert str(Color.RED | Color.BLUE | Color.GREEN) == "Color.GREEN|BLUE|RED"
----------
nosy: +iritkatriel
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com