Articles for June 2006
Python Globals and Bytecode
Recently I found myself, for my own obscure reasons, wanting to know (at runtime, by introspection) which variables a piece of Python code read.
At first glance, this looked fairly straightforward. Python's eval statement takes three parameters: a code object to run, and two dictionaries for the global and local variables. Since you can subclass a dictionary and override its getters it seemed trivial to monitor what was read, using some variation on a theme of:
We Apologise For The Inconvenience
Just a quick heads-up: Between hosting issues and time constraints there's not been much going on here — and until hosting was sorted out, I didn't want to put new content up that people wouldn't be able to access :)
I now have new hosting arranged for Wooji Juice and will be transferring everything over soon. There may be some temporary downtime during the move.