I have to maintain code which uses dataclasses. In these, methods from libraries are imported and associated and I find the way it's done confusing and not very readable. It's done like this (a very simplified example) :
from dataclasses import dataclassfrom code.custom.package import method_a, method_b@dataclassclass myClass: import numpy as np var1: str var2: str var3: np.ndarray = NonemyClass.method_a = method_amyClass.method_b = method_b
The methods generally do operations on the data structures contained in the class.
Is this a common practice ? Is this the proper way to do this ? Or should this be avoided and done in another way ?