scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
769 stars 223 forks source link

Add some type hints #123

Open wannaphong opened 3 years ago

wannaphong commented 3 years ago

Add some type hints for python

Gallaecio commented 3 years ago

This project still supports Python 2

wannaphong commented 3 years ago

This project still supports Python 2

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

Gallaecio commented 3 years ago

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.