[Python-ideas] Object grabbing
Joshua Morton
joshua.morton13 at gmail.com
Mon May 2 21:41:08 EDT 2016
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.
--Josh
On Mon, May 2, 2016 at 7:32 PM Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:
> Joshua Morton wrote:
> > would something like replacing all attribute access with a
> >
> > try:
> > x
> > except NameError:
> > namespace.x # or something like this
> >
> > work, or are you saying that since 'namespace' wouldn't be in slots
> > either, this would fail?
>
> I meant that Namespace can't be an ordinary Python object
> that works without cooperation from the compiler. If the
> compiler is allowed to recognise the use of Namespace
> and generate different code, anything is possible.
>
> --
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160503/8ed451e4/attachment.html>
More information about the Python-ideas
mailing list