Let's say I have a module mod_x
like the following:
class X:
pass
x=X()
Now, let's say I have another module that just performs import mod_x
, and goes about its business. The module variable x
will not be referenced further during the lifecycle of the interpreter.
Will the class instance x
get garbage collected at any point except at the termination of the interpreter?