let’s assume i have two python modules a, and b.
a.py:
CONSTANT = 2
b.py:
from a import CONSTANT
CONSTANT2 = 4
if i use
b.__dict__
or
inspect.getmembers(b)
I get CONSTANT and CONSTANT2 but how do i get only CONSTANT (imported)? or how can i filter the results to get only CONSTANT?
what i want to have in the end is actually “a”, the modules from which b imports