diff options
author | Thomas Wouters <thomas@python.org> | 2006-08-23 23:20:29 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-08-23 23:20:29 (GMT) |
commit | 9a6e62b947ebb5547ca9a164f6145a461b98d86a (patch) | |
tree | d566337c0211e6a515a987d0d682635885973f83 /Lib/test | |
parent | fbfe0936078e16829f36a6e61b511c123fd17b17 (diff) | |
download | cpython-9a6e62b947ebb5547ca9a164f6145a461b98d86a.zip cpython-9a6e62b947ebb5547ca9a164f6145a461b98d86a.tar.gz cpython-9a6e62b947ebb5547ca9a164f6145a461b98d86a.tar.bz2 |
Fix buglet in slice assignment of bytesobjects: assigning to b[3:0] ('stop'
being before 'start') would actually assign to b[0:0] (or whatever 'stop'
was)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_bytes.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index d45ff64..210f08c 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -235,6 +235,9 @@ class BytesTest(unittest.TestCase): b[3:5] = [3, 4, 5, 6] self.assertEqual(b, bytes(range(10))) + + b[3:0] = [42, 42, 42] + self.assertEqual(b, bytes([0, 1, 2, 42, 42, 42, 3, 4, 5, 6, 7, 8, 9])) def test_setslice_trap(self): # This test verifies that we correctly handle assigning self |