Skip to content

Commit

Permalink
gh-118820: Zero-valued flag enum has no name (GH-118848)
Browse files Browse the repository at this point in the history
Co-authored-by: Bénédikt Tran <[email protected]>
  • Loading branch information
nineteendo and picnixz authored Jun 19, 2024
1 parent 753ef8d commit ed5ae6c
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 ed5ae6c

Please sign in to comment.