<div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">Right that makes sense. Is there any precedent for non-keywords being special cased by the compiler (I'm thinking specifically of Exceptions)? There's obviously from __future__ imports, but I think going in that direction would be simultaneously elegant, explicit, backwards compatible, and an awful idea.</span><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">--Josh</div><br><div class="gmail_quote"><div dir="ltr">On Mon, May 2, 2016 at 7:32 PM Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Joshua Morton wrote:<br>
> would something like replacing all attribute access with a<br>
><br>
>     try:<br>
>         x<br>
>     except NameError:<br>
>         namespace.x  # or something like this<br>
><br>
> work, or are you saying that since 'namespace' wouldn't be in slots<br>
> either, this would fail?<br>
<br>
I meant that Namespace can't be an ordinary Python object<br>
that works without cooperation from the compiler. If the<br>
compiler is allowed to recognise the use of Namespace<br>
and generate different code, anything is possible.<br>
<br>
--<br>
Greg<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div></div>