kuroko/test/testUpvalueClosureOnEarlyReturnOrLoopExit.krk
2023-11-24 18:32:16 +09:00

24 lines
343 B
Python

let closures = []
for i in range(3):
let a
try:
a = 'bad'
closures.append(lambda: print(a))
continue
finally:
a = f'good {i}'
def foo():
let a
try:
a = 'bad'
closures.append(lambda: print(a))
return
finally:
a = 'good'
foo()
for i in closures:
i()