[Python-checkins] r86958 - python/branches/py3k/Lib/weakref.py

georg.brandl python-checkins at python.org
Fri Dec 3 08:49:09 CET 2010


Author: georg.brandl
Date: Fri Dec  3 08:49:09 2010
New Revision: 86958

Log:
Use booleans.

Modified:
   python/branches/py3k/Lib/weakref.py

Modified: python/branches/py3k/Lib/weakref.py
==============================================================================
--- python/branches/py3k/Lib/weakref.py	(original)
+++ python/branches/py3k/Lib/weakref.py	Fri Dec  3 08:49:09 2010
@@ -166,7 +166,7 @@
     def popitem(self):
         if self._pending_removals:
             self._commit_removals()
-        while 1:
+        while True:
             key, wr = self.data.popitem()
             o = wr()
             if o is not None:
@@ -324,7 +324,7 @@
         try:
             wr = ref(key)
         except TypeError:
-            return 0
+            return False
         return wr in self.data
 
     def items(self):
@@ -362,7 +362,7 @@
         return list(self.data)
 
     def popitem(self):
-        while 1:
+        while True:
             key, value = self.data.popitem()
             o = key()
             if o is not None:


More information about the Python-checkins mailing list