From c3be5caf21d64d0267da3f815b345f77daa113db Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 23:17:51 +0000 Subject: [PATCH] refactor: change methods not using its bound instance to staticmethods 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](https://docs.python.org/3/library/functions.html#staticmethod). --- game.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game.py b/game.py index d79fb93..832768c 100644 --- a/game.py +++ b/game.py @@ -410,5 +410,6 @@ def render(self): pygame.display.flip() self.clock.tick(30) # Ограничиваем FPS - def close(self): + @staticmethod + def close(): pygame.quit()