[issue45705] |= set update scoping

Pablo Galindo Salgado report at bugs.python.org
Wed Nov 3 16:34:29 EDT 2021


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is not a bug. You are getting an UnboundLocalError because in the scope of scoped_def function, scoped_dict is marked as local (because you assign to it in the function) but you are reading it before that. 

Please, take a look at:

https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value

and possibly at

https://docs.python.org/3.3/tutorial/classes.html#python-scopes-and-namespaces
https://docs.python.org/3/library/exceptions.html#UnboundLocalError

----------
resolution:  -> not a bug
stage: resolved -> 

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


More information about the Python-bugs-list mailing list