<div><span class="gmail_quote">On 2/18/07, <b class="gmail_sendername">Pierre-Yves Martin</b> <<a href="mailto:pym.aldebaran@gmail.com">pym.aldebaran@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="gmail_quote"></span>Currently it's possible to customize attribute access via methods :<br>
<br>__getattribute__(self, name)<br>__getattr__(self, name)<br>__setattr__(self, name, value)<br><br><br>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: 
<br><br>__getlocal__(name)<br>__setlocal__(name, value)</blockquote>
<div> </div>
<div>-1</div>
<div> </div>
<div>IMO this would allow changing the basic behavior of Python too much. Variable assignment should be variable assignment.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>- Tal Einat</div><br> </div>