-
Notifications
You must be signed in to change notification settings - Fork 106
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 #143
Comments
@adamchainz - an alternate place to contribute these stubs is the typeshed project! I found your issue while enabling the mypy --strict flag on my own project. |
Yeah that might be the solution given no response here. If you want to take my hints and open a typeshed PR please feel free! |
We are also interested in this. If it is working, can it be merged please? |
Hey folks! Sorry for the delay here. I'd love to have type hint support, and would be more than happy to help get a PR working (although I confess I'm just coming back to Python after a couple of years in TypeScript land, and not yet fully up to speed on best practices). If you could open a PR that gives an example of how to test that the project is covered by types, I'd be happy to help get them put in place. |
I just had a look at doing this but found the python 2/3 compatibility code a bit "in the way". It will be hard to get Mypy to properly check it. I think all the compat code should be removed first. |
Good news, @adamchainz! Python 2 support is dropped in 0.9! I haven't removed all the compat code yet, but if you can point me in the right direction for how to test with mypy, I'm happy to help iterate on it. I'm going to cut a 0.9 release today, and adding typing support seems like a feature worthy of a 1.0 release. |
Any updates on v1.0 and/or typing mypy support for this? Would love to have it! Thanks. |
I found adding type hints too hard so I wrote my own more minimal parametrised unittest library: https://pypi.org/project/unittest-parametrize/ . It copies pytest’s API as much as possible and comes with full types. |
I've been rolling out Mypy on a client project. When activating the
disallow_untyped_decorators
flag, I found I needed type hints for parametrized. I added the below to the project's stubs folder (onmypy_path
:These hints cover the main usage of parameterized. If you're interested, I wouldn't mind contributing full type hint coverage to the package.
The text was updated successfully, but these errors were encountered: