A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-November/122649.html below:

[Python-Dev] Improve error message "UnboundLocalError: local variable referenced before assignment"

[Python-Dev] Improve error message "UnboundLocalError: local variable referenced before assignment" [Python-Dev] Improve error message "UnboundLocalError: local variable referenced before assignment"Jan Matějek jmatejek at suse.cz
Mon Nov 12 16:30:41 CET 2012
Dne 31.10.2012 23:15, Steven D'Aprano napsal(a):

>> I wonder if this message can be improved with a
>> pointer to the concept on when global variables become local?
>
> If you have a suggestion for an improved message, please tell us. Or raise
> an issue on the bug tracker.

I believe the "human problem" here is that the one tends to gloss over "local 
variable VARNAME", because it describes VARNAME and you already think you know 
what that is, so you don't stop to think about it.

The following would be better in this regard, IMO:

"Variable VARNAME is local in FUNCNAME, but doesn't have a value at line 123"

regards
m.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4