Skip to content
New issue

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

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

Already on GitHub? # to your account

[Draft] Add types (POC) #243

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

superleesa
Copy link

@superleesa superleesa commented Oct 26, 2024

Add output (and maybe input) types to response (requests).
For details, please see: #199

How to achive this:

  • use generic to distinguish client of Endpoint instance between Client and AsyncClient
  • use the generic and overload decorator to add two overloads (one for sync and another one async) of each request method

@superleesa superleesa changed the title Add types (POC) [Draft] Add types (POC) Oct 26, 2024
@@ -131,15 +131,16 @@ def _parse_response(self, response: Response) -> Any:

return body

@abstractclassmethod
@abstractmethod
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

def request(
self,
path: str,
method: str,
cast_to: Type[ResponseType],
Copy link
Owner

@ramnes ramnes Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid to add this new cast_to argument?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants