Skip to content

Commit

Permalink
pythongh-118820: Zero-valued flag enum has no name (pythonGH-118848)
Browse files Browse the repository at this point in the history
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
2 people authored and noahbkim committed Jul 11, 2024
1 parent 7f9a5e0 commit 5e756d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Doc/howto/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,14 @@ the following are true:
>>> (Color.RED | Color.GREEN).name
'RED|GREEN'

>>> class Perm(IntFlag):
... R = 4
... W = 2
... X = 1
...
>>> (Perm.R & Perm.W).name is None # effectively Perm(0)
True

- multi-bit flags, aka aliases, can be returned from operations::

>>> Color.RED | Color.BLUE
Expand Down

0 comments on commit 5e756d3

Please sign in to comment.