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/string_repr.py

5 lines
188 B
Python
Raw Normal View History

Change comments (mainly URLs) to no longer specifically say Python 3.3
2014-06-06 03:51:03 +10:00
# anything above 0xa0 is printed as Unicode by CPython
objstr: Be 8-bit clean even for repr(). This will allow roughly the same behavior as Python3 for non-ASCII strings, for example, print("<phrase in non-Latin script>".split()) will print list of words, not weird hex dump (like Python2 behaves). (Of course, that it will print list of words, if there're "words" in that phrase at all, separated by ASCII-compatible whitespace; that surely won't apply to every human language in existence).
2014-06-13 21:23:00 +03:00
# the abobe is CPython implementation detail, stick to ASCII
for c in range(0x80):
tests/basics: Use str.format instead of % for formatting messages. Only use % formatting when testing % itself, because only str.format is guaranteed to be available on any port.
2019-10-18 19:18:06 +11:00
print("0x{:02x}: {}".format(c, repr(chr(c))))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 211ms Template: 0ms
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