Python PEP479 Change StopIteration handling inside generators
问题 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: