summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index ffa28a6..ecf1976 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -183,6 +183,17 @@ class ReferencesTestCase(TestBase):
self.assertEqual(L3[:5], p3[:5])
self.assertEqual(L3[2:5], p3[2:5])
+ def test_proxy_unicode(self):
+ # See bug 5037
+ class C(object):
+ def __str__(self):
+ return "string"
+ def __bytes__(self):
+ return b"bytes"
+ instance = C()
+ self.assertTrue("__bytes__" in dir(weakref.proxy(instance)))
+ self.assertEqual(bytes(weakref.proxy(instance)), b"bytes")
+
def test_proxy_index(self):
class C:
def __index__(self):