From: Georg Brandl Date: Fri, 3 Dec 2010 07:49:09 +0000 (+0000) Subject: Use booleans. X-Git-Tag: v3.2b1~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd87d0862bd0ea3d978a27ca558a5f7ec4b32fe2;p=thirdparty%2FPython%2Fcpython.git Use booleans. --- diff --git a/Lib/weakref.py b/Lib/weakref.py index 66c4dc6ffbb7..468f8f102902 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: