Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/tests/basics/bytes_add.py

12 lines
209 B
Python
Raw Normal View History

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.
2014-11-05 16:30:34 +00:00
# test bytes + other
print(b"123" + b"456")
print(b"123" + bytearray(2))
import array
tests: Split byteorder-dependent tests to *_endian.py's.
2015-08-30 00:30:28 +03:00
# should be byteorder-neutral
print(b"123" + array.array('h', [0x1515]))
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.
2014-11-05 16:30:34 +00:00
print(b"\x01\x02" + array.array('b', [1, 2]))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 76ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API