← index #2628PR #1460
Off-topic · high · value 0.380
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

py/objgetitemiter: Allow to work with native objects.

closedby pfalconopened 2015-09-13updated 2015-09-18

Previously, this class expected to be fed with obj.getitem bound method.
But native objects instead have .subscr slot method. So, make it possible
to reuse this iterator even for such objects, if called with {obj, NULL}
structure.

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