I have this Python 3 pseudo-code:
def f1():
a, b, c, d, e, f = some_other_fn()
if (condition):
f2(a, b, c, d, e, f)
def f2(a, b, c, d, e, f):
complex_set_of_operations_with(a, b, c, d, e, f)
for i in range(1000):
f(1)
Now, I am kind of annoyed at the long signature and repetition in f2()
and would like to encapsulate that into f1()
:
def f1():
def f2():
complex_set_of_operations_with(a, b, c, d, e, f)
a, b, c, d, e, f = some_other_fn()
if (condition):
f2()
for i in range(1000):
f(1)
Now, my question is: if I run f1()
a thousand times, does the interpreter have to parse f2()
a thousand times or is it smart enough to create a reusable reference?