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 <1392659027.56.0.320916972318.issue20663@psf.upfronthosting.co.za>
In-reply-to
Content
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`.
History
Date User Action Args
2014-02-17 17:43:47cool-RRsetrecipients: + cool-RR, terry.reedy
2014-02-17 17:43:47cool-RRsetmessageid: <1392659027.56.0.320916972318.issue20663@psf.upfronthosting.co.za>
2014-02-17 17:43:47cool-RRlinkissue20663 messages
2014-02-17 17:43:46cool-RRcreate