A general question for someone that knows function definition internals better than I do.
In general, is there a performance trade off to doing something like this:
def my_function():
def other_function():
pass
# do some stuff
other_function()
Versus:
def other_function():
pass
def my_function():
# do some stuff
other_function()
I've seen developers inline functions before to keep a small, single use function close to the code that actually uses it, but I always wondered if there were a memory (or compute) performance penalty for doing something like this.
Thoughts?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With