Lets say we have two python files:
A:
class c(object):pass
def f(obj):
if type(obj) == c:
print("Object is of type c!")
else:
print("Object is not of type c.")
print(f"Type c: {c}")
print(f"Type of the object: {type(obj)}")
o = c()
B:
import A
o = A.c()
Now lets run A in shell or using the -i arguments in a command line, import B and call f using the object we created in B as an argument.
>>> import B
>>> f(B.o)
Object is not of type c.
Type c: <class '__main__.c'>
Type of the object: <class 'A.c'>
Can I some how fix this?
Just to clarify: I do want to execute a program like A and then import a program like B. I just want to know if I can somehow make f work in this context.