summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-30 12:05:02 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-30 12:05:02 (GMT)
commiteb2c964aeb0ab0e3e01560c955cab95f8e3b92c2 (patch)
tree3e4996e95e8ad04013886498d590b0ef59a1fb5e
parent1e7217de49d06130bb7a68c1d21868f9ad85cd2f (diff)
downloadcpython-eb2c964aeb0ab0e3e01560c955cab95f8e3b92c2.zip
cpython-eb2c964aeb0ab0e3e01560c955cab95f8e3b92c2.tar.gz
cpython-eb2c964aeb0ab0e3e01560c955cab95f8e3b92c2.tar.bz2
Add test case for r63810.
-rw-r--r--Lib/test/test_bytes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 206dde9..4b346d6 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -832,6 +832,11 @@ class AssortedBytesTest(unittest.TestCase):
def test_rsplit_bytearray(self):
self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
+ def test_return_self(self):
+ # bytearray.replace must always return a new bytearray
+ b = bytearray()
+ self.failIf(b.replace(b'', b'') is b)
+
# Optimizations:
# __iter__? (optimization)
# __reversed__? (optimization)