← index #2628PR #358
Related · medium · value 1.707
QUERY · ISSUE

Extend obj->iternext to handle not just __next__(), but also send() method

openby pfalconopened 2016-11-13updated 2017-06-30
rfc

For generators (generalization of iterators), .__next__() method is defined as .send(None). It's only natural to extend C-level ->iternext() method to accept send argument, to allow implementation of C-level generators optimally. Caveat: so far, none of such exist. But work on optimizing uasyncio may lead to need for such. Or maybe not, maybe "virtual" awaitable methods will be used instead: https://github.com/micropython/micropython/issues/2622 .

This ticket is created to be referenced by in-code TODO comments (yes, I think we reached that code complexity that need to reference tickets straight from code).

CANDIDATE · PULL REQUEST

objgenerator: Implement exception handling for generators

mergedby pfalconopened 2014-03-22updated 2014-07-10

This is required to properly handle exceptions across yields.

This fixes initial issue identified in #243.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied