Raymond Hettinger added the comment:
I concur with Jim and Steven, so we'll mark this a closed.
If you want to go forward, consider bringing this up on python-ideas. If it
gets a favorable reception, this can be re-opened.
--
nosy: +rhettinger
resolution: -> rejected
stage: ->
Jim Jewett added the comment:
Why would you raise StopIteration if you didn't want to stop the nearest
iteration loop? I agree that the result of your sample code seems strange, but
that is because it is strange code.
I agree with Steven D'Aprano that changing it would cause more pain than
Steven D'Aprano added the comment:
Converting *all* exceptions into RuntimeError is certainly not a good idea,
especially since you include KeyboardInterrupt and other non-errors.
I'm probably going to be on the losing side of this one (I lost the argument
back when a similar issue was
New submission from DarrenDanielDay :
# The following is a tricky example:
# This is an example function that possibly raises `StopIteration`.
# In some cases, this function may raise `StopIteration` in the first iteration.
def raise_stop_iteration(param):
if param == 10:
raise