Storing value with limits in object

Josip fake.mail at
Sun Jun 22 13:34:35 CEST 2008

> In theory you could hack Python's internal locals or globals
> dictionary so that it did something unusual while looking up your
> object. But in practice this doesn't work, because the returned
> objects (when you call globals() or locals()) attributes are readonly.
> Probably because those internal lookup dicts are implemented in
> optimized C not Python, and the C implementation doesn't let you
> redefine it's internals via the Python interface.
> David.

I'll settle for implementing the __call__() method to return the value as I 
no intention to mess around with Python's internal mechanisms.

Thanks a lot for your deep insight. 

More information about the Python-list mailing list