<div dir="ltr"><br><br><div class="gmail_quote">On Tue, May 10, 2011 at 16:11, R. David Murray <span dir="ltr">&lt;<a href="mailto:rdmurray@bitdance.com">rdmurray@bitdance.com</a>&gt;</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 &lt;<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>&gt; wrote:<br>
&gt; With an unlimited error message length it could make sense to say &quot;Hey, I<br>
&gt; see &#39;x&#39; may be assigned in this scope, so I mark it local. But this access<br>
&gt; to &#39;x&#39; happens before assignment - so ERROR&quot;. This isn&#39;t realistic, of<br>
&gt; course, so I&#39;m wondering:<br>
&gt;<br>
&gt; 1. Does this error message (although unrealistic) capture all possible<br>
&gt; appearances of UnboundLocalError?<br>
&gt; 2. If the answer to (1) is yes - could it be usefully shortened to be<br>
&gt; clearer than the current &quot;local variable referenced before assignment&quot;?<br>
&gt;<br>
&gt; This may not be possible, of course, but it doesn&#39;t harm trying :-)<br>
<br>
</div>How about:<br>
<br>
&quot;reference to variable &#39;y&#39; precedes an assignment that makes it a local<br>
variable&quot;<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>