What is the name of the name space I am in?

A

Anthra Norell

I try to use "new.new.classobj (name, baseclass, dict)" and have no clue
what the "dict" of the current name space is. I can name dicts of
imported modules, because their name exists in the current name space.
If, for instance, I import a module "service" then that module's name
space would be "service.__dict__". But if I import * from service, then
I incorporate that name space into the current one and I cannot name it,
because the current module's name is not part of the module's own name
space. "dir (service)" is equivalent to "service.__dict__.keys ()" if
service is importet. "dir ()" is equivalent to "?.__dict__.keys ()"
where "?" is the name of the current module, itself not part of the
current module's name space. So the question mark stands for an implicit
name that can be neither named nor dropped. So my question is: how does
one name the dictionary of the name space one is in?

Frederic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top