On 13 September 2017 at 02:17, Neil Schemenauer
<nas-python-id...@arctrix.com> wrote:
> Introducing another special feature of modules to make this work is
> not the solution, IMHO.  We should make module namespaces be more
> like instance namespaces.  We already have a mechanism and it is
> getattr on objects.

One thing to keep in mind is that class instances *also* allow their
attribute access machinery to be bypassed by writing to the
instance.__dict__ directly - it's just that the instance dict may be
bypassed on lookup for data descriptors.

So that means we wouldn't need to change the way globals() works -
we'd just add the caveat that amendments made that way may be ignored
for things defined as properties.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to