[New-bugs-announce] [issue33527] Invalid child function scope

gasokiw report at bugs.python.org
Tue May 15 16:56:10 EDT 2018


New submission from gasokiw <gasokiw at stelliteop.info>:

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.

----------
files: example and workaround.zip
messages: 316725
nosy: gasokiw
priority: normal
severity: normal
status: open
title: Invalid child function scope
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47594/example and workaround.zip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33527>
_______________________________________


More information about the New-bugs-announce mailing list