]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
SF bug #1012315: weakref.WeakValueDictionary should override .has_key()
authorRaymond Hettinger <python@rcn.com>
Thu, 19 Aug 2004 21:32:06 +0000 (21:32 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 19 Aug 2004 21:32:06 +0000 (21:32 +0000)
commit61146790992e0a00b76a6bf6ecc9e53289a1ecd7
tree20852192a2cc52157dd0ea92f3507b958fa6a9cd
parent3a3817f506801e4a1e62d8cd52e1c8aa0feb2993
SF bug #1012315:  weakref.WeakValueDictionary should override .has_key()

* Check the found object for a None value during a contains/has_key
  lookup.  Perhaps it will help the OP who is likely suffering from an
  occassional GC or threading object deletion after self.data is checked.

* Complete the previous patch by removing the unnecessary indirection
  for weak dict iterators.  Makes the code cleaner and more readable.
Lib/weakref.py