[Python-checkins] r81679 - python/trunk/Lib/site.py

benjamin.peterson python-checkins at python.org
Thu Jun 3 23:21:03 CEST 2010


Author: benjamin.peterson
Date: Thu Jun  3 23:21:03 2010
New Revision: 81679

Log:
use a set for membership testing

Modified:
   python/trunk/Lib/site.py

Modified: python/trunk/Lib/site.py
==============================================================================
--- python/trunk/Lib/site.py	(original)
+++ python/trunk/Lib/site.py	Thu Jun  3 23:21:03 2010
@@ -276,12 +276,12 @@
     environment, and will return a list of full paths.
     """
     sitepackages = []
-    seen = []
+    seen = set()
 
     for prefix in PREFIXES:
         if not prefix or prefix in seen:
             continue
-        seen.append(prefix)
+        seen.add(prefix)
 
         if sys.platform in ('os2emx', 'riscos'):
             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))


More information about the Python-checkins mailing list