mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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)
This commit is contained in:
parent
fbfe093607
commit
9a6e62b947
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue