Inner function created every time the outer function runs
Also defined during run-time, but in every call of bar() the innter_func is redefined again and again.
import random
def foo():
return random.random()
print(foo())
print(foo())
def bar(a, b = foo()):
def inner_func(x, y = foo()):
return [x, y]
print('inner', inner_func(a))
return [a, b]
print(bar(1))
print(bar(2))
{% embed include file="src/examples/advanced-functions/runtime-inner-def.out)