how can get the module global symbol table from a function or method which it is called?

Y

ygao

when a function or method is called,how can get the module global
symbol table from which
it is called,not the module where it is defined(this is easy).
thanks!
 
A

Alex Martelli

ygao said:
when a function or method is called,how can get the module global
symbol table from which
it is called,not the module where it is defined(this is easy).
thanks!

You can play with module inspect, or sys._getframe, but they're meant
essentially for *debugging* purposes -- if what you have in mind is not
related to debugging, but rather some hack to design a highly unPythonic
API, I earnestly urge you to reconsider your design intent.


Alex
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top