This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ammar2
Recipients Gabriele Tornetta, ammar2
Date 2020-01-31.10:46:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580467569.23.0.556127862656.issue39506@roundup.psfhosted.org>
In-reply-to
Content
Take a look at https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value

What's happening is that because `a |= x` is treated as an assignment, i.e `a = a | x`. The compiler treats it as a local variable, but since it hasn't been initialized in inner() before it reaches `a |= set(["A"])` it fails with UnboundLocalError.
History
Date User Action Args
2020-01-31 10:46:09ammar2setrecipients: + ammar2, Gabriele Tornetta
2020-01-31 10:46:09ammar2setmessageid: <1580467569.23.0.556127862656.issue39506@roundup.psfhosted.org>
2020-01-31 10:46:09ammar2linkissue39506 messages
2020-01-31 10:46:09ammar2create