diff options
Diffstat (limited to 'tests/basics/bytearray_add_self.py')
| -rw-r--r-- | tests/basics/bytearray_add_self.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/bytearray_add_self.py b/tests/basics/bytearray_add_self.py new file mode 100644 index 000000000..94ae8689f --- /dev/null +++ b/tests/basics/bytearray_add_self.py @@ -0,0 +1,8 @@ +# add a bytearray to itself +# This is not supported by CPython as of 3.11.18. + +b = bytearray(b"123456789") +for _ in range(4): + c = bytearray(b) # extra allocation increases chance 'b' has to relocate + b += b +print(b) |
