summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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