Skip to content

Conversation

wannaphong
Copy link

Add some type hints for python

Add some type hints for python
@Gallaecio
Copy link
Member

This project still supports Python 2

@wannaphong
Copy link
Author

This project still supports Python 2

OK.I changed type hints to type checking. https://stackoverflow.com/a/35230792

@Gallaecio
Copy link
Member

Gallaecio commented Oct 2, 2020

Nice! I did not know about that syntax possible, and it looks like mypy supports it as well.

Do you think you could also add a Travis CI job that runs mypy to check annotations, excluding all files for now except the ones you’ve updated?

You would need to modify tox.ini and .travis.yml in the root folder. If you look for typing in the corresponding files of https://github.com/scrapy/scrapy , you’ll see how it can be done.

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 this pull request may close these issues.

2 participants