1# Make sure that write operations on io.BytesIO don't
2# change original object it was constructed from.
3try:
4    import uio as io
5except ImportError:
6    import io
7
8b = b"foobar"
9
10a = io.BytesIO(b)
11a.write(b"1")
12print(b)
13print(a.getvalue())
14
15b = bytearray(b"foobar")
16
17a = io.BytesIO(b)
18a.write(b"1")
19print(b)
20print(a.getvalue())
21