On Wed, Nov 7, 2012 at 11:57 PM, Ulrich Eckhardt <ulrich.eckhardt at dominolaser.com> wrote: > 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"? Unfortunately, we don't track the information we would need in order to emit that kind of error message. However, you did give me an idea: I believe the compiler is actually in a position to emit SyntaxWarning for functions that have a high chance of triggering UnboundLocalError when called. With output pointing to *both* problematic lines, beginners should stand a better chance of figuring out what is going on. (http://bugs.python.org/issue16429) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
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