From: Nice Zombies Date: Wed, 19 Jun 2024 20:09:53 +0000 (+0200) Subject: gh-118820: Zero-valued flag enum has no name (GH-118848) X-Git-Tag: v3.14.0a1~1404 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed5ae6c4d76feaff06c2104c8ff864553b000253;p=thirdparty%2FPython%2Fcpython.git gh-118820: Zero-valued flag enum has no name (GH-118848) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst index 748ec5b24365..18e13fcf9f59 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