
On 2/18/07, Pierre-Yves Martin <pym.aldebaran@gmail.com> wrote:
Currently it's possible to customize attribute access via methods :
__getattribute__(self, name) __getattr__(self, name) __setattr__(self, name, value)
but it is not possible to customize local variable access. It would be useful for example to allow implementation of a local constant or any other on-access/on-modification behavior. The function should could be:
__getlocal__(name) __setlocal__(name, value)
-1 IMO this would allow changing the basic behavior of Python too much. Variable assignment should be variable assignment. I am generally wary of such behind-the-scenes magic, since it can easily be taken too far, resulting in highly unreadable code -- not very Pythonic. - Tal Einat