Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Client class #30

Open
LakiG opened this issue Feb 16, 2023 · 0 comments
Open

Refactor Client class #30

LakiG opened this issue Feb 16, 2023 · 0 comments

Comments

@LakiG
Copy link
Collaborator

LakiG commented Feb 16, 2023

The Client class has methods with many recurring arguments. The class can be refactored on the following lines for better usability.

  • Initiate a client with only those parameters that you need for multiple instance methods and that will be the same for every request. You don't want to instantiate a new client for every request you send.
  • Remove all parameters from the instance methods that you already pass when instantiating the client and refer to them as self.param. No param should be passed to both the class constructor and any of the instance methods.
  • Obviously define only those params in an instance method that you really need.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant