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

Add type hints for qBittorrent's API payloads #371

Open
rmartin16 opened this issue Nov 6, 2023 · 0 comments
Open

Add type hints for qBittorrent's API payloads #371

rmartin16 opened this issue Nov 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@rmartin16
Copy link
Owner

What is the problem or limitation you are having?

The items in dictionaries returned from qBittorrent are not defined or typed. This makes interacting with this these response payloads more cumbersome and opaque than necessary.

Describe the solution you'd like

Type hints exist for the response payloads such that IDEs and type checkers can use them.

As suggested in #337, the response payload definitions would subclass TypedDict. While this approach probably makes the most sense, it conflicts with the existing design of response definitions which subclass AttrDict. Currently, it is not possible to multiple inheritance with TypedDict unless all base class are subclasses of TypedDict. So, I'm not really sure the best way to achieve this....unless the AttrDict stuff is dropped....but that would be a huge break in backwards compatibility that'd I'd like to avoid.

Describe alternatives you've considered

Status quo

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant