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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
177 B
Python
Raw Normal View History

py: Implement support for generalized generator protocol. Iterators and ducktype objects can now be arguments of yield from.
2014-03-30 23:14:55 +03:00
def gen():
yield from (1, 2, 3)
def gen2():
yield from gen()
py: iternext() may not return MP_OBJ_NULL, only MP_OBJ_STOP_ITERATION. Testing for incorrect value led to premature termination of generator containing yield from for such iterator (e.g. "yield from [1, 2]").
2015-05-10 00:41:34 +03:00
def gen3():
yield from (4, 5)
yield 6
py: Implement support for generalized generator protocol. Iterators and ducktype objects can now be arguments of yield from.
2014-03-30 23:14:55 +03:00
print(list(gen()))
print(list(gen2()))
py: iternext() may not return MP_OBJ_NULL, only MP_OBJ_STOP_ITERATION. Testing for incorrect value led to premature termination of generator containing yield from for such iterator (e.g. "yield from [1, 2]").
2015-05-10 00:41:34 +03:00
print(list(gen3()))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 217ms 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