https://github.com/python/cpython/commit/ed5ae6c4d76feaff06c2104c8ff864553b000253
commit: ed5ae6c4d76feaff06c2104c8ff864553b000253
branch: main
author: Nice Zombies <[email protected]>
committer: ethanfurman <[email protected]>
date: 2024-06-19T13:09:53-07:00
summary:

gh-118820: Zero-valued flag enum has no name (GH-118848)

Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Doc/howto/enum.rst

diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst
index 748ec5b24365d1..18e13fcf9f59bd 100644
--- a/Doc/howto/enum.rst
+++ b/Doc/howto/enum.rst
@@ -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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to