So I have a module.py like this:
import dataclass
@dataclass
class A:
x: int
y: int
def big_method(self):
do_big_stuff(x,y)
LIST_OF_A = [ A(2,3), B(4,5) ]
Why when in my script.py when I do
from module import A
the script.py actually ran and instantiated LIST_OF_A ? The only way I fix it is to separate the file from the class definition and the LIST_OF_A. Is there a way to combine it both in one module.py?