Apr-11-2022, 05:42 PM
Say I have a module, "sneaky.py". The first time
Is there something
sneaky
is imported, the body of the module runs. (On subsequent imports, sneaky
is just loaded from the module cache.)Is there something
sneaky
can do to identify the module that imported it that first time? (On subsequent imports, obviously not.)# sneaky.py if module_importing_me is spam: ...