non-dictionary namespace?

darius at connect.com.au darius at connect.com.au
Sat Dec 25 21:22:21 EST 1999


Hey all,

So I'm playing around with building methods and objects and things on the
fly, and I'm wondering:  Why is it that I _have_ to pass a dictionary into
new.function and eval as their global namespace?  Why can't I pass a
dictionary-like object (something that defines __getitem__ and etc calls)
in, so I can trap attempts to write to the namespace and do funky things with
them (like actually copy them out to somewhere permanent rather than the
transient space that's built for eval() commands at the moment...)?

I had a look at the sourcecode for newmodule.c and for funcobject.c, and
it's all so beautifully abstracted that I can't tell off-hand whether there's
a good reason for this restriction or not *grin*

Anyone more knowledgeable than me in these things can help me out?

TIA,
KevinL

--------------- qnevhf at obsu.arg.nh ---------------
Kevin Littlejohn, Technical Architect, Connect.com.au
Don't let the Govt censor our access to the 'net -
http://www.efa.org.au/Campaigns/stop.html
---------- telnet mud.bofh.net.au 5000 -----------



More information about the Python-list mailing list