<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2015 at 05:33, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> Also, since classes inside functions are commonly used in unit tests (at<br>
> least mine :-), I worry that *any* changes in this behavior might break<br>
> working code (no matter how much that "working" could be considered an<br>
> accident, it's still going to be a bear to debug if this happens to you).<br>
<br>
</span>Agreed - I think any change here would need to go through a<br>
deprecation period where we warned about cases where LOAD_NAME would<br>
be changed to LOAD_CLASSDEREF and there was a nonlocal defined with<br>
that name.<br>
<br>
Since it's trivial easy to workaround by renaming a local variable to<br>
use a name that differs from the nested class attribute, I'd also be<br>
entirely happy with leaving the current behaviour as an obscure quirk<br>
- I'm only +0 on changing it, and also +0 on declaring it "not worth<br>
the hassle of changing".<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">This is also my attitude on this issue. Looks like everyone agrees that this is<br></div><div class="gmail_extra">a strange behavior, but not strange enough to be changed.<br></div></div>