Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python with statement local variables

A with statement does not create a scope (like if, for and while do not create a scope either).
As a result, Python will analyze the code and see that you made an assignment in the with statement, and thus that will make the variable local (to the real scope).
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #statement #local #variables
ADD COMMENT
Topic
Name
7+3 =