<div dir="ltr">Ooops. My proof on anti-concept has a flaw.  It only "shadows" names that already exist.  Presumably that's the wrong idea, but it's easy enough to change if desired.<div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 29, 2018 at 5:24 PM, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@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="">On 29 April 2018 at 21:20, Tim Peters <<a href="mailto:tim.peters@gmail.com">tim.peters@gmail.com</a>> wrote:<br>
> As covered most recently in an exchange with Tim Delaney, best I can<br>
> tell absolutely nobody has wanted that.  By "sublocal scope" they<br>
> don't mean a full-fledged new scope at all, but a kind of limited<br>
> "shadowing" of a handful of specific, explicitly given names.  It acts<br>
> like a context manager, if there were a way to clearly spell<br>
><br>
>     save the current state of these specific identifiers at the start (& I<br>
>         couldn't care less whether they're local, nonlocal, or global - I<br>
>         don't know & don't care)<br>
><br>
>     then execute the code exactly as if this gimmick had never been used<br>
><br>
>     then, at the end, restore the specific identifier states we saved<br>
> at the start<br>
<br>
</span>So maybe adding such a primitive (maybe something live states =<br>
sys.get_variable_state('a', 'b', 'c') and<br>
sys.set_variable_state(states)<wbr>) would be useful? Of course, we've<br>
moved away from real use cases and back to theoretical arguments now,<br>
so it's entirely possible that doing so would only solve problems that<br>
no-one actually has... David Mertz' sublocal context manager would be<br>
a good prototype of such a thing - at least good enough to demonstrate<br>
that it's of no benefit in practice <wink><br>
<span class="HOEnZb"><font color="#888888"><br>
Paul<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons.  Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div>
</div></div>