diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py
index c18d42f..917b6cf 100644
--- a/Lib/packaging/create.py
+++ b/Lib/packaging/create.py
@@ -175,11 +175,11 @@
 def _build_classifiers_dict(classifiers):
     d = {}
     for key in classifiers:
-        subDict = d
+        subdict = d
         for subkey in key.split(' :: '):
-            if not subkey in subDict:
-                subDict[subkey] = {}
-            subDict = subDict[subkey]
+            if subkey not in subdict:
+                subdict[subkey] = {}
+            subdict = subdict[subkey]
     return d
 
 CLASSIFIERS = _build_classifiers_dict(_CLASSIFIERS_LIST)
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):
diff --git a/Lib/packaging/depgraph.py b/Lib/packaging/depgraph.py
index 70b7b84..b3c555a 100644
--- a/Lib/packaging/depgraph.py
+++ b/Lib/packaging/depgraph.py
@@ -58,7 +58,7 @@
         """
         self.adjacency_list[x].append((y, label))
         # multiple edges are allowed, so be careful
-        if not x in self.reverse_list[y]:
+        if x not in self.reverse_list[y]:
             self.reverse_list[y].append(x)
 
     def add_missing(self, distribution, requirement):
@@ -157,7 +157,7 @@
                     raise PackagingError('distribution %r has ill-formed'
                                          'provides field: %r' % (dist.name, p))
                 version = version[1:-1]  # trim off parenthesis
-            if not name in provided:
+            if name not in provided:
                 provided[name] = []
             provided[name].append((version, dist))
 
@@ -174,7 +174,7 @@
 
             name = predicate.name
 
-            if not name in provided:
+            if name not in provided:
                 graph.add_missing(dist, req)
             else:
                 matched = False
@@ -216,7 +216,7 @@
         node = fringe.pop()
         dep.append(node)
         for prev in graph.reverse_list[node]:
-            if not prev in dep:
+            if prev not in dep:
                 fringe.append(prev)
 
     dep.pop(0)  # remove dist from dep, was there to prevent infinite loops
diff --git a/Lib/packaging/pypi/dist.py b/Lib/packaging/pypi/dist.py
index db04cda..d3824c2 100644
--- a/Lib/packaging/pypi/dist.py
+++ b/Lib/packaging/pypi/dist.py
@@ -256,7 +256,7 @@
                 hashlib.new(hashname)
             except ValueError:
                 raise UnsupportedHashName(hashname)
-        if not url in [u['url'] for u in self.urls]:
+        if url not in [u['url'] for u in self.urls]:
             self.urls.append({
                 'url': url,
                 'hashname': hashname,
@@ -329,7 +329,7 @@
         url param"""
         hashname = self.url['hashname']
         expected_hashval = self.url['hashval']
-        if not None in (expected_hashval, hashname):
+        if None not in (expected_hashval, hashname):
             with open(filename, 'rb') as f:
                 hashval = hashlib.new(hashname)
                 hashval.update(f.read())
@@ -409,7 +409,7 @@
                                  (release.name, self.name))
             version = str(release.version)
 
-            if not version in self.get_versions():
+            if version not in self.get_versions():
                 # append only if not already exists
                 self.releases.append(release)
             for dist in release.dists.values():
diff --git a/Lib/packaging/pypi/simple.py b/Lib/packaging/pypi/simple.py
index 777fa93..1dcb8ce 100644
--- a/Lib/packaging/pypi/simple.py
+++ b/Lib/packaging/pypi/simple.py
@@ -283,7 +283,7 @@
             name = release.name
         else:
             name = release_info['name']
-        if not name.lower() in self._projects:
+        if name.lower() not in self._projects:
             self._projects[name.lower()] = ReleasesList(name, index=self._index)
 
         if release:
@@ -321,7 +321,7 @@
                             # it's a distribution, so create a dist object
                             try:
                                 infos = get_infos_from_url(link, project_name,
-                                            is_external=not self.index_url in url)
+                                            is_external=self.index_url not in url)
                             except CantParseArchiveName as e:
                                 if self.verbose:
                                     logger.warning(
