File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1045,15 +1045,15 @@ Generator Cleanup with ``.close()``
10451045 finally :
10461046 print (" outer generator received GeneratorExit" )
10471047
1048- # With yield from - GeneratorExit is passed through to sub-generator
1048+ # With yield from, GeneratorExit is passed through to sub-generator
10491049 gen1 = yield_from()
10501050 print (next (gen1)) # prints "first"
10511051 gen1.close() # closes sub-generator and then outer generator
10521052
1053- # With explicit loop - GeneratorExit goes to outer generator first
1053+ # With explicit loop, GeneratorExit goes to outer generator only
10541054 gen2 = explicit_loop()
10551055 print (next (gen2)) # prints "first"
1056- gen2.close() # only closes outer generator
1056+ gen2.close() # only closes outer generator
10571057
10581058 print (' program finished; GC will close the explicit loop subgenerator' )
10591059 # second inner generator closes when GC closes it at the end
You can’t perform that action at this time.
0 commit comments