When you try to reassign variable with same name as one of parameters/arguments of parent function to local scope in child function, even if it doesn't actually get ran, the argument/parameter is not passed to child function anymore.
In practice this happens when you make decorator with arguments/parameters and make wrapper function inside it.
As workaround you can redeclare those arguments/parameters in new variables in parent function then rewrite them back in child function. ( as seen in child_function_scope_bodge.py )
Please view attachment to better understand the issue. |