[3.13] gh-118820: Zero-valued flag enum has no name (GH-118848) (GH-120759)

gh-118820: Zero-valued flag enum has no name (GH-118848)
(cherry picked from commit ed5ae6c4d7)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-06-20 00:11:30 +02:00 committed by GitHub
parent 355d928e55
commit e415d2561b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -1150,6 +1150,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