New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of order commands excecution? #39612
Comments
Consider the following: >>> import string
>>> def test1():
join = string.join
>>> def test2():
join = string.join
string = string.split
Traceback (most recent call last):
File "<pyshell#9>", line 1, in -toplevel-
test2()
File "<pyshell#7>", line 2, in test2
join = string.join
UnboundLocalError: local variable 'string' referenced
before assignment
>>> How the second statement in test2 generates an error in Nadav. |
Logged In: YES Well, that's just how it works. This must be documented helps (and maybe the question before). |
Logged In: YES I've looked at the FAQ and it is not seems to sesolve the Nadav. |
Logged In: YES If a variable is local in a function, it is local throughout |
Logged In: YES Well, you reopened the bug, so you're obviously not happy. |
Logged In: YES I understand that this is just a documentation issue. I Thank you very much for your help Nadav. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: