This is for a project I am working on to help my own workflow, and nothing that is for production. So I understand that what I am doing is probably definitely not the right thing to do, but I am curious if it is possible anyways.
I have some code like this:
A.py:
from B import *
def f1():
...
def f2():
...
...
Is there any way for module B
, when imported, to get a list of the functions defined in the importer, A.py
?
I thought about using the inspect module, to inspect the call stack. But I was unsure where the entry point would be, I assume it would be in the global scope of B.py
. I am also unsure what the call stack looks like when importing a module.
Any help would be appreciated.
Thanks!