Is this sound software engineering practice for class construction?
问题 Is this a plausible and sound way to write a class where there is a syntactic sugar @staticmethod that is used for the outside to interact with? Thanks. ###scrip1.py### import SampleClass.method1 as method1 output = method1(input_var) ###script2.py### class SampleClass(object): def __init__(self): self.var1 = 'var1' self.var2 = 'var2' @staticmethod def method1(input_var): # Syntactic Sugar method that outside uses sample_class = SampleClass() result = sample_class._method2(input_var) return