I know the title is very confusing but essentially here is what I am trying to do:
def foo():
bar(name)
def evaluate_foo(name_table):
def bar(name, lookup_table=name_table):
print(name + "'s last name is " + lookup_table[name])
foo()
Basically, if I know that foo is going to make a call to bar, can I replace bar with my own function right before calling foo?
I am trying to provide a lookup table to bar, but the lookup table is generated inside of evaluate_foo. It's also important to me that someone using the function bar doesn't need to know about the lookup table that is being used by bar within it.
baris local toevaluate_foo.foocannot see it. What are you trying to accomplish?