https://github.com/python/cpython/commit/6421db1d4d86c645034ecf6cce163a02318b67c0 commit: 6421db1d4d86c645034ecf6cce163a02318b67c0 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: ethanfurman <[email protected]> date: 2024-06-19T15:11:58-07:00 summary:
[3.12] gh-118820: Zero-valued flag enum has no name (GH-118848) (GH120758) gh-118820: Zero-valued flag enum has no name (GH-118848) (cherry picked from commit ed5ae6c4d76feaff06c2104c8ff864553b000253) Co-authored-by: Nice Zombies <[email protected]> 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 ffdafb749c73a9..04a1b3e41b7c06 100644 --- a/Doc/howto/enum.rst +++ b/Doc/howto/enum.rst @@ -1129,6 +1129,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]
