[Zope-dev] pythonmethods and namespaces.
Anthony Baxter
anthony@interlink.com.au
Sat, 29 Jan 2000 23:53:52 +1100
A note in one of Chris' tutorials reminded me of this...
the need to whack a self. on the front of every acquired attribute
inside a pythonmethod is slowly driving me insane.
from what I can see, the issue is that Python itself won't accept
anything but a dictionary for the namespace arguments to exec or
eval()... right? This means you can't pass a MultiMapping to it...
I'm assuming this is so for performance, or is it just because
that's how it's always been? Is this likely to be changed?
Can anyone else see a way out of this? I thought about adding
something to MultiMappings to allow you to generate a proper dictionary
from the MM, but that would bite for performance in a big way...
Hm, might try hacking the interpreter's source to switch the test
from PyDict_Check to PyMapping_Check, see what happens...
Anthony