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

Type-hints in ServerAPI (and global api) #175

Open
iLLiCiTiT opened this issue Aug 19, 2024 · 2 comments
Open

Type-hints in ServerAPI (and global api) #175

iLLiCiTiT opened this issue Aug 19, 2024 · 2 comments
Labels
type: enhancement New feature or request

Comments

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Aug 19, 2024

Description

It would be nice to have typehints not just in docstrings but also in arguments. With that we might also add arguments with typehints to public functions in _api.py so IDE can actually show them.

Suggestion

Add type hints to ServerAPI methods, and modify automated_api.py to copy args/kwargs with typehints too.

@iLLiCiTiT iLLiCiTiT added the type: enhancement New feature or request label Aug 19, 2024
@iLLiCiTiT iLLiCiTiT changed the title Typehints in ServerAPI (and global api) Type-hints in ServerAPI (and global api) Aug 19, 2024
@BigRoy
Copy link

BigRoy commented Aug 19, 2024

I wonder if something like this could work: https://stackoverflow.com/a/71031698
See also: https://stackoverflow.com/a/68290080

We may need to somehow magically do that via "Docstrings" instead to have some form of backwards compatibility?

@iLLiCiTiT
Copy link
Member Author

I already have prepared concept for stubs, but we first need to add typehints to ServerAPI.

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

No branches or pull requests

2 participants