Message369592
>But then why I still can access this variable? Shouldn't it then be
resulting in NameError as it's undefined variable at this point of time?
I don't think so, this is the same as if you do:
def f(exc):
del exc
return exc
>>> f(3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "lel.py", line 3, in f
return exc
UnboundLocalError: local variable 'exc' referenced before assignment |
|
Date |
User |
Action |
Args |
2020-05-22 11:15:13 | pablogsal | set | recipients:
+ pablogsal, Mark.Shannon, oleksandr.suvorov |
2020-05-22 11:15:13 | pablogsal | set | messageid: <1590146113.54.0.656385533998.issue40728@roundup.psfhosted.org> |
2020-05-22 11:15:13 | pablogsal | link | issue40728 messages |
2020-05-22 11:15:13 | pablogsal | create | |
|