Could someone help me understand what PEP479 is about? I was reading the doc and couldn't get my head around it.
The abstract says:
This PEP proposes a change to generators: when StopIteration is raised inside a generator, it is replaced it with RuntimeError. (More precisely, this happens when the exception is about to bubble out of the generator's stack frame.)
So for example, does a loop like so still work?
it = iter([1,2,3])
try:
i = next(it)
while True:
i = next(it)
except StopIteration:
pass
Or does it mean that if I have a generator definition like so:
def gen():
yield from range(5)
raise StopIteration
the StopIteration
is going to be replaced with RuntimeError
?
I would really appreciate if someone could shed some light on this.