Method doesn't use the class instance and could be converted into a static method
38 def limits(self):
39 return self.limits
40
41 def get_number(self, min_max=[1, 10]): 42 """Get a random number between min and max."""
43 assert all([isinstance(i, int) for i in min_max])
44 return random.randint(*min_max)
Method doesn't use the class instance and could be converted into a static method
18 def __init__(self):
19 self.limits = (1, 10)
20
21 def get_number(self, min_max): 22 raise NotImplemented
23
24 def smethod():
Description
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.