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 steven.daprano
Recipients jhewitt, matrixise, steven.daprano
Date 2018-10-25.20:32:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20181025203226.GN3817@ando.pearwood.info>
In-reply-to <4c5edf3e-8c01-15c0-b094-0d192345b5a0@caurinus.com>
Content
Yes, that's exactly right. That's how local variables work in Python:

x = 999  # global x
def demo():
   if False:
       x = 1
   x  # local x has no value

does the same thing. This is standard, documented behaviour, regardless 
of which kind of assignment statement you use.
History
Date User Action Args
2018-10-25 20:32:45steven.dapranosetrecipients: + steven.daprano, matrixise, jhewitt
2018-10-25 20:32:45steven.dapranolinkissue35069 messages
2018-10-25 20:32:45steven.dapranocreate