@staticmethod
PYL-R0201 9 self.html = "<h1>Hello world!</h1>"
10 self.config = self.load_config()
11
12 def load_config(self):13 with open("C:\config.json") as file:
14 file_contents = file.read()
15 config = json.loads(file_contents)
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)
18 def __init__(self):
19 self.limits = (1, 10)
20
21 def get_number(self, min_max): 22 raise NotImplemented
23
24 def smethod():
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.