Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd87d08

Browse files
committed
Use booleans.
1 parent d80d5f4 commit bd87d08

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/weakref.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def values(self):
166166
def popitem(self):
167167
if self._pending_removals:
168168
self._commit_removals()
169-
while 1:
169+
while True:
170170
key, wr = self.data.popitem()
171171
o = wr()
172172
if o is not None:
@@ -324,7 +324,7 @@ def __contains__(self, key):
324324
try:
325325
wr = ref(key)
326326
except TypeError:
327-
return 0
327+
return False
328328
return wr in self.data
329329

330330
def items(self):
@@ -362,7 +362,7 @@ def keyrefs(self):
362362
return list(self.data)
363363

364364
def popitem(self):
365-
while 1:
365+
while True:
366366
key, value = self.data.popitem()
367367
o = key()
368368
if o is not None:

0 commit comments

Comments
 (0)