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/122578.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"Skip Montanaro skip at pobox.com
Wed Nov 7 15:16:57 CET 2012
> How about:
>
>   "UnboundLocalError: Local variable 'FONT_NAMES' (created on
>    line 11) referenced before assignment."
>
> What I don't really like is the term "created". Maybe "implicitly created
> on line 11"? Or "implied by line 11"? Or how about "Local variable
> FONT_NAMES (implied by line 11) doesn't refer to an object", to avoid the
> multiple interpretations of the term "assignment"?

It's been a long (long) while since I looked at the virtual machine
implementation, but my guess is that at the point where the error is
detected the system won't know what line number corresponds to the
assignment.  There might also be multiple assignments.  How would you
know which one to pick?

As for a better word than "created", I would use "assigned."

Skip
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