Simple question that i cant figure out: I have (example) file one with this:
class foo:
var = 1
def bar(self):
print(self.var)
if __name__ == "__main__":
foo().bar()
and file2 with this:
from testing import foo
class foo2:
def bar2(self):
foo().var = 2
foo().bar()
foo2().bar2()
It returns 1, so no overwriting happening here.
I cant figure out how to actually overwrite the variable of the imported class instance. I checked this and this but that didnt help me. Sorry for asking such a simple question, thanks in advance.