summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-03-31 04:07:55 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-03-31 04:07:55 (GMT)
commit4cf27049b68a2c1dca643638f319966ba3fae4ee (patch)
tree8778069ea28c8c6fb9cbcd0aef60ef347c90a887 /Lib
parentb7f4c2d03af4c7d3960df64b7ae4139520c9fdcf (diff)
downloadcpython-4cf27049b68a2c1dca643638f319966ba3fae4ee.zip
cpython-4cf27049b68a2c1dca643638f319966ba3fae4ee.tar.gz
cpython-4cf27049b68a2c1dca643638f319966ba3fae4ee.tar.bz2
SF bug #1770766: weakref proxy has incorrect __nonzero__ behavior.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_weakref.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 75869a7..2754cec 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -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)