Skip to content

Commit

Permalink
refactor: change methods not using its bound instance to staticmethods (
Browse files Browse the repository at this point in the history
#35)

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).

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] authored Jun 23, 2024
1 parent 61d62a2 commit caf9c22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gpt_computer_agent/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def disable_online_tools(self) -> str:
response = self.send_request("/deactivate_online_tools", {})
return response["response"]

def wait(self, second):
@staticmethod
def wait(second):
time.sleep(second)


Expand Down

0 comments on commit caf9c22

Please sign in to comment.