Commit bd87d086 authored by Georg Brandl's avatar Georg Brandl

Use booleans.

parent d80d5f4e
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment