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

[FEATURE REQUEST] type hints? #41

Open
jicruz96 opened this issue Jul 12, 2024 · 7 comments · Fixed by #42
Open

[FEATURE REQUEST] type hints? #41

jicruz96 opened this issue Jul 12, 2024 · 7 comments · Fixed by #42

Comments

@jicruz96
Copy link
Contributor

It'd be nice if this package had more type hints and .pyi files to get a better IDE experience when using the package under strict type checkers.

Would the package maintainer be okay with me providing a PR that adds type hints and .pyi files to the package?

I'd ensure type hints are compatible with Python >=3.8.

@yaph
Copy link
Owner

yaph commented Jul 13, 2024

Hi thanks for your proposal! Do you intend to add the type hints exclusively in .pyi files?

@jicruz96
Copy link
Contributor Author

Hi thanks for your proposal! Do you intend to add the type hints exclusively in .pyi files?

@yaph I intended to add type hints directly to the source code then use stubgen to produce the .pyi files directly from source, but am happy to keep the source code untouched if preferred.

@yaph
Copy link
Owner

yaph commented Jul 15, 2024

Directly in the source is fine for me. Are the .pyi really necessary in that case? I'd rather not put generated files into git.

@jicruz96
Copy link
Contributor Author

Are the .pyi really necessary in that case?

They're not. A user can auto-gen the stub files themselves. I'll submit a PR in a day or two then (:

@yaph
Copy link
Owner

yaph commented Jul 17, 2024

Fine thank you!

@jicruz96 jicruz96 mentioned this issue Jul 18, 2024
@jicruz96
Copy link
Contributor Author

@yap A Pull Request is now available for review: #42

@yaph yaph closed this as completed in #42 Jul 25, 2024
@yaph
Copy link
Owner

yaph commented Jul 26, 2024

I get linting errors with regards to the types. The tool suggests to use from __future__ import annotations rather than importing from typing. The End of Life of Python 3.8 is in a few months and I think the 3.0 release is a good opportunity to drop support for it. So from typing import ... could be removed and types like Dict need to be rewritten as dict etc. What are your thoughts on this and would you want to make these changes?

@yaph yaph reopened this Jul 26, 2024
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

Successfully merging a pull request may close this issue.

2 participants