3 ms·
> My current understanding is that the log_calls method would NOT get executed during module load time!?! That's incorrect. log_calls gets executed on import b
by scrollaway 7y ago
> My current understanding is that the log_calls method would NOT get executed during module load time!?!
That's incorrect. log_calls gets executed on import because it's a decorator, so equivalent to `hello_world = log_calls(hello_world)` at the top-level (which does also get executed).
log_to_network in the _wrapped() definition doesn't get executed until hello_world gets called; but outside of the definition of _wrapped does get executed.
- konschubert 7y agoRight! I missed the fact that log_calls is used as a decorator further down.