On Jun 25, 2019, at 14:00, nate lust <natel...@linux.com> wrote:
> 
> This message is related to two previous threads, but was a sufficiently 
> evolved to warrant a new topic.
> 
> I am proposing that two new magic methods be added to python that will 
> control assignment and loading of class
> instances. This means that if an instance is bound to a variable name, any 
> attempts to rebind that name will
> result in a call to the __setself__ (name negotiable) of the instance already 
> bound to that name.  Likewise
> when a class instance bound to a name is loaded by the interpreter, if 
> present, the __getself__ method of that
> instance will be called and its result will be returned instead. I have been 
> internally calling these cloaking
> variables as they "cloak" the underlying instance, parallelling the idea of 
> shadowing. Feel free to suggest
> better names.                              

Does this still have the same issues as your previous version, like sometimes 
working for locals and sometimes not, affecting values stored in dicts that 
aren’t namespaces, not working for namespaces that aren’t dicts (slots classes, 
custom modules, etc.), type doing the wrong thing, and so on? 

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/2PUO4ZOJHKI7DP46SBLMFZHC7IXOMV4L/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to