summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-03 07:49:09 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-03 07:49:09 (GMT)
commitbd87d0862bd0ea3d978a27ca558a5f7ec4b32fe2 (patch)
treebfaddb19b16dca5a5121a453e13fcb91ea8e5a70 /Lib
parentd80d5f4ee8cd19e7e9a1080c3e3a5e1af74b7d07 (diff)
downloadcpython-bd87d0862bd0ea3d978a27ca558a5f7ec4b32fe2.zip
cpython-bd87d0862bd0ea3d978a27ca558a5f7ec4b32fe2.tar.gz
cpython-bd87d0862bd0ea3d978a27ca558a5f7ec4b32fe2.tar.bz2
Use booleans.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/weakref.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index 66c4dc6..468f8f1 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -166,7 +166,7 @@ class WeakValueDictionary(collections.MutableMapping):
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 @@ class WeakKeyDictionary(collections.MutableMapping):
try:
wr = ref(key)
except TypeError:
- return 0
+ return False
return wr in self.data
def items(self):
@@ -362,7 +362,7 @@ class WeakKeyDictionary(collections.MutableMapping):
return list(self.data)
def popitem(self):
- while 1:
+ while True:
key, value = self.data.popitem()
o = key()
if o is not None: