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_endswith_upy.py

7 lines
130 B
Python
Raw Normal View History

py/objstr: startswith, endswith: Check arg to be a string. Otherwise, it will silently get incorrect result on other values types, including CPython tuple form like "foo.png".endswith(("png", "jpg")) (which MicroPython doesn't support for unbloatedness).
2017-08-29 00:06:21 +03:00
# MicroPython doesn't support tuple argument
try:
"foobar".endswith(("bar", "sth"))
except TypeError:
print("TypeError")
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 129ms 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