From: "Guido van Rossum" <guido@python.org> > > Now I'm wondering if there isn't a better way for Python to get > > ahold of the current module's __name__ in this case, if you don't > > want to change what PyEval_GetGlobals() does. > > If you can rigorously define "current module" I can propose an API. A rigorous definition is easy; I can't promise it would always meet everyone's expectations: The "current module" is given by the current formula (PyEval_GetGlobals(), etc.) except when loading an extension module, in which case the current module is the one most recently created. I'm not sure, but this might be simplifiable to: the "current module" is the one most recently created. -Dave
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4