Style change in packaging: use “not in” over “not x in”.
Such tests are IMO easier to read if both operators are grouped.
diff --git a/Lib/packaging/database.py b/Lib/packaging/database.py
index 22d4b13..e3c57ba 100644
--- a/Lib/packaging/database.py
+++ b/Lib/packaging/database.py
@@ -104,12 +104,12 @@
for dist in _yield_distributions(gen_dist, gen_egg, paths):
if isinstance(dist, Distribution):
_cache_path[dist.path] = dist
- if not dist.name in _cache_name:
+ if dist.name not in _cache_name:
_cache_name[dist.name] = []
_cache_name[dist.name].append(dist)
else:
_cache_path_egg[dist.path] = dist
- if not dist.name in _cache_name_egg:
+ if dist.name not in _cache_name_egg:
_cache_name_egg[dist.name] = []
_cache_name_egg[dist.name].append(dist)
@@ -150,7 +150,7 @@
self.version = self.metadata['Version']
self.path = path
- if _cache_enabled and not path in _cache_path:
+ if _cache_enabled and path not in _cache_path:
_cache_path[path] = self
def __repr__(self):