Message211431
See discussion: https://groups.google.com/forum/#!searchin/python-ideas/iter/python-ideas/UCaNfAHkBlQ/5vX7JbpCxDkJ
`iter` has a very cool `sentinel` argument. I suggest an additional argument `exception`; when it's supplied, instead of waiting for a sentinel value, we wait for a sentinel exception to be raised, and then the iteration is finished.
This'll be useful to construct things like this:
my_iterator = iter(my_deque.popleft, exception=IndexError)
I also suggest being able to pass multiple exceptions in a tuple to have any of them trigger a `StopIteration`. |
|
Date |
User |
Action |
Args |
2014-02-17 17:43:47 | cool-RR | set | recipients:
+ cool-RR, terry.reedy |
2014-02-17 17:43:47 | cool-RR | set | messageid: <1392659027.56.0.320916972318.issue20663@psf.upfronthosting.co.za> |
2014-02-17 17:43:47 | cool-RR | link | issue20663 messages |
2014-02-17 17:43:46 | cool-RR | create | |
|