This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR, terry.reedy
Date 2014-02-17.17:43:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
See discussion:!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:47cool-RRsetrecipients: + cool-RR, terry.reedy
2014-02-17 17:43:47cool-RRsetmessageid: <>
2014-02-17 17:43:47cool-RRlinkissue20663 messages
2014-02-17 17:43:46cool-RRcreate