On 7 November 2012 13:57, Ulrich Eckhardt <ulrich.eckha...@dominolaser.com> wrote: > Am 31.10.2012 23:15, schrieb Steven D'Aprano: > I'll take a shot, since I was also bitten by this when trying to learn > Python. The important point is that some code earlier or later in that > function does an assignment, so this location should be referenced in the > error.
+1 > 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"? Why not make use of the well defined words already there in the error message, but at the line number "UnboundLocalError: Local variable 'FONT_NAMES' referenced before it has been assigned to on line 11." Sam _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com