summaryrefslogtreecommitdiffstats
path: root/HACKING.rst
diff options
context:
space:
mode:
Diffstat (limited to 'HACKING.rst')
-rw-r--r--HACKING.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/HACKING.rst b/HACKING.rst
index 7dda11a..3f6a3ed 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -27,6 +27,18 @@ General
mylist = Foo().list() # OKAY, does not shadow built-in
+- Use the "not in" operator for collection membership evaluation. Example::
+
+ if not X in Y: # BAD, hard to understand
+ pass
+
+ if X not in Y: # OKAY, intuitive
+ pass
+
+ if not (X in Y or X is Z): # OKAY, still better than all those 'not's
+ pass
+
+
TODO vs FIXME
-------------