mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF bug #1770766: weakref proxy has incorrect __nonzero__ behavior.
This commit is contained in:
parent
ca5d8fea3d
commit
e6c470f255
2 changed files with 7 additions and 5 deletions
|
@ -271,6 +271,12 @@ class ReferencesTestCase(TestBase):
|
|||
del f[0]
|
||||
self.assertEqual(f.result, 0)
|
||||
|
||||
def test_proxy_bool(self):
|
||||
# Test clearing of SF bug #1170766
|
||||
class List(list): pass
|
||||
lyst = List()
|
||||
self.assertEqual(bool(weakref.proxy(lyst)), bool(lyst))
|
||||
|
||||
def test_getweakrefcount(self):
|
||||
o = C()
|
||||
ref1 = weakref.ref(o)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue