-
Notifications
You must be signed in to change notification settings - Fork 113
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
[suggestion] adding type hints? #199
Comments
I think dropping python 2.7 support won't be a problem |
would you be open to a PR introducing type hints & dropping 2.7 support? |
Yes that would be helpful 👍 If you plan to make any code changes while dropping 2.7 support (e.g. clean-up six imports and other stuff required only for python 2.7), then I think it would be better to do so in a separate PR, and then add hints. Regarding python 3 versions, I think we can definitely drop 3.5 support. In case 3.6 support would be a problem, we can discuss dropping that as well. |
Also, any thoughts on adding something like |
Re black, we use it in a few projects, such as https://github.com/scrapinghub/web-poet/ and https://github.com/scrapinghub/scrapy-poet, and the folks running these projects are happy with the setup (cc @BurnzZ ). Do you have a preferred approach or experience migrating other projects @sbdchd ? |
It'd be cool if we also have pre-commit hooks available with |
yeah basically in my experience adding type hints changes a ton of formatting, so having black helps a bit -- plus I like the look of the output :D |
I see this package supports python 2.7 so the type hints would have to be the comment variety:
https://web.archive.org/web/20220213164145/https://mypy.readthedocs.io/en/stable/cheat_sheet.html
Essentially:
instead of:
edit: another option would be some type stub files
.pyi
The text was updated successfully, but these errors were encountered: