[Python-Dev] Temporary Constantification (original) (raw)

Eric Sumner kd5bjo at gmail.com
Mon Jun 26 01:17:47 CEST 2006


On 6/25/06, Guido van Rossum <guido at python.org> wrote:

Unfortunately, a mechanism that would let you register a callback for when a particular variable or attribute used in a cached expression is used, is pretty hard to implement without affecting the performance of code that doesn't use it. I'm afraid this is not a very likely path towards a solution.

I could make a strong argument that it is actually impossible to implement without affecting the performance of other code; the only issue is whether or not the impact is acceptable. I may be wrong, but I think that this particular scheme minimizes the impact:

Without knowing more about the internals of Python (such as how long a check of a single variable takes relative to binding a new value to a name), I can't properly evaluate how much of a problem this would be.

-- Eric Sumner



More information about the Python-Dev mailing list