summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-19 22:11:30 (GMT)
committerGitHub <noreply@github.com>2024-06-19 22:11:30 (GMT)
commite415d2561b0410c21ab8627aa10b90b1145b1c70 (patch)
tree6d228688c5c21e0f121ce8391e0991f57f421f33 /Doc
parent355d928e55d7c82f91989d08653215cb7e151c6e (diff)
downloadcpython-e415d2561b0410c21ab8627aa10b90b1145b1c70.zip
cpython-e415d2561b0410c21ab8627aa10b90b1145b1c70.tar.gz
cpython-e415d2561b0410c21ab8627aa10b90b1145b1c70.tar.bz2
[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 ed5ae6c4d76feaff06c2104c8ff864553b000253) Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/howto/enum.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst
index 30be152..0b122ae 100644
--- a/Doc/howto/enum.rst
+++ b/Doc/howto/enum.rst
@@ -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