cachecontrol icon indicating copy to clipboard operation
cachecontrol copied to clipboard

Add type annotations

Open dimbleby opened this issue 3 years ago • 2 comments

I probably should have checked first whether this is something you even want, but if the answer is "no thanks" then fair enough: it wasn't so much work that either of us need feel bad about that.

I've added type annotations everywhere, and mypy configuration to check them. I haven't tried to update your github workflows, but all you should need to do is run like this:

$ mypy cachecontrol
Success: no issues found in 13 source files

dimbleby avatar Jul 04 '22 23:07 dimbleby

These are great! We had a very minimal set of type hints for cachecontrol; and I updated our type hints to match yours in https://github.com/common-workflow-language/schema_salad/commit/be8da2e23bd6e871b8f9cff93f955ddfcb52f95b ; and our type checking still pass.

One note would be to add a mypy test in tox.ini, so that future PRs are also checked.

mr-c avatar Sep 13 '22 10:09 mr-c

I would love to see this merged and in the next release :-)

This PR also adds py.typed, the PEP-561 advertisement that this package carries its own type information. This is very useful to me, thanks.

mr-c avatar Sep 13 '22 11:09 mr-c