diff options
author | Damien George <damien.p.george@gmail.com> | 2014-11-05 16:30:34 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-11-05 16:30:34 +0000 |
commit | a65c03c6c07fa8b092f7cd8d02c81e9ef8cd4a50 (patch) | |
tree | 6ae81153044692f3ac874580e91183aa4bc36cff /tests/basics/bytes_add.py | |
parent | 346aacf27f9bdfe8416efc30e2611f53dfc0cf5c (diff) | |
download | micropython-a65c03c6c07fa8b092f7cd8d02c81e9ef8cd4a50.tar.gz micropython-a65c03c6c07fa8b092f7cd8d02c81e9ef8cd4a50.zip |
py: Allow +, in, and compare ops between bytes and bytearray/array.
Eg b"123" + bytearray(2) now works. This patch actually decreases code
size while adding functionality: 32-bit unix down by 128 bytes, stmhal
down by 84 bytes.
Diffstat (limited to 'tests/basics/bytes_add.py')
-rw-r--r-- | tests/basics/bytes_add.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/bytes_add.py b/tests/basics/bytes_add.py new file mode 100644 index 0000000000..1288d5ac33 --- /dev/null +++ b/tests/basics/bytes_add.py @@ -0,0 +1,9 @@ +# test bytes + other + +print(b"123" + b"456") +print(b"123" + bytearray(2)) + +import array + +print(b"123" + array.array('i', [1])) +print(b"\x01\x02" + array.array('b', [1, 2])) |