@staticmethod
PYL-R0201 50
51 def close(self): ...
52
53 def errorString(self) -> str: 54 return 'error'
55
56
45 def try_connect(self, port: int) -> bool:
46 return True
47
48 def isListening(self) -> bool: 49 return False
50
51 def close(self): ...
42 def __init__(self, editor: MockEditorController, parent=None):
43 super().__init__(parent)
44
45 def try_connect(self, port: int) -> bool: 46 return True
47
48 def isListening(self) -> bool:
29 def __str__(self) -> str:
30 return pformat(self.data)
31
32 def load(self, settings_file: pathlib.Path) -> Dict[str, Any]:33 with settings_file.open() as f:
34 return json.load(f)
35
27 def __init__(self, settings: _NssSettings):
28 self._settings = settings
29
30 def get_ip(self): 31 """Get the IP address of the current machine."""
32 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
33 try:
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.