<div dir="ltr"><br><br><div class="gmail_quote">On Tue, May 10, 2011 at 16:11, R. David Murray <span dir="ltr"><<a href="mailto:rdmurray@bitdance.com">rdmurray@bitdance.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 10 May 2011 08:36:38 +0300, Eli Bendersky <<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>> wrote:<br>
> With an unlimited error message length it could make sense to say "Hey, I<br>
> see 'x' may be assigned in this scope, so I mark it local. But this access<br>
> to 'x' happens before assignment - so ERROR". This isn't realistic, of<br>
> course, so I'm wondering:<br>
><br>
> 1. Does this error message (although unrealistic) capture all possible<br>
> appearances of UnboundLocalError?<br>
> 2. If the answer to (1) is yes - could it be usefully shortened to be<br>
> clearer than the current "local variable referenced before assignment"?<br>
><br>
> This may not be possible, of course, but it doesn't harm trying :-)<br>
<br>
</div>How about:<br>
<br>
"reference to variable 'y' precedes an assignment that makes it a local<br>
variable"<br>
<font color="#888888"><a href="http://www.bitdance.com" target="_blank"></a></font></blockquote><div><br>Yes, this is much better and not too long IMHO<br>Eli <br></div></div><br></div>