[Python-ideas] Map and filter should also convert StopIteration to RuntimeError
chris.barker at noaa.gov
Fri Dec 12 22:59:15 CET 2014
On Fri, Dec 12, 2014 at 1:44 PM, Oscar Benjamin <oscar.j.benjamin at gmail.com>
> I guess the question is: should it be considered a bug for an iterator
> to leak a StopIteration outside of its "normal" exit condition?
> Apparently it was for generators
I don't think anyone aid it was a bug -- often it is a bug, but that's
which represent the majority of all
> iterators and it was considered sufficiently important to change the
> core language in a backward incompatible way.
It is considered prone to hard to find and understand bugs -- which was the
motivation for the PEP.
Christopher Barker, Ph.D.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas