Meta programming question
Jeff Epler
jepler at unpythonic.net
Sun Sep 28 10:13:41 EDT 2003
The changes are not large, if I understand what the OP is asking for.
However, they have a performance impact on the "common case".
In Python, a dict subclass's __setitem__ is never invoked when
evaluating bytecode. With a change to just a few opcodes (STORE_GLOBAL,
STORE_NAME), this can be rectified, so that
>>> exec "x = 3" in d
will call d.__setitem__("x", 3), and you can do whatever you need to do
on "assignment".
The patch was never finished, and never added to the sf patch manager.
You can visit the python-dev thread at
http://mail.python.org/pipermail/python-dev/2002-October/029761.html
Jeff
More information about the Python-list
mailing list