Message19155
Consider the following:
>>> import string
>>> def test1():
join = string.join
>>> def test2():
join = string.join
string = string.split
>>> test1()
>>> test2()
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
first one?
Nadav. |
|
Date |
User |
Action |
Args |
2007-08-23 14:18:30 | admin | link | issue850110 messages |
2007-08-23 14:18:30 | admin | create | |
|