25 Sep
2014
25 Sep
'14
5:33 a.m.
On 25 September 2014 08:09, Cathal Garvey
The idea is that `continue with` would allow injection of any datatype or variable, which becomes the next iterated item. So, saying `continue with 5` means that the next *x* in a loop structured as `for x in..` would be 5.
You can effectively do this just with generators. def process(iterable): for e in iterable: yield e yield -e for e in process([1, 2, 3]): print(e) If you need to get more complex, investigate the send() method of generators. Tim Delaney