Steven D'Aprano <[email protected]> added the comment:
> I'm off to write an ugly `next()` wrapper then.
Wouldn't it be simpler to re-design the generators to yield the final
result instead of returning it? To process the final item differently
from the rest, you just need something like this:
last = next(it)
for x in it:
process(last)
last = x
special_handling(last)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com