Open matthewspeck opened 6 years ago
Great idea! If you had the time to contribute something like that I would definitely be interested.
Alright I'll take a stab at this :)
Just a drive-by comment: wouldn’t it be better to add type hints directly to the code here? typeshed stubs are only solution in emergency for libraries which are unmaintained or unwilling to add typehints to the code proper.
Type annotations are different between Python 2 and Python 3, otherwise I wouldn't mind adding the annotations and submitting a PR. @kquick - Since Python 2 is EOL, would you allow the codebase to evolve to be only Python 3 compliant? Any plans or objections to a migration?
@todd-cook I think it's reasonable to finally drop Python 2 support, so I have no objections to a migration.
I would also be open to type hints directly in the code, per @mcepl 's comment.
Type annotations are different between Python 2 and Python 3, otherwise I wouldn't mind adding the annotations and submitting a PR. @kquick - Since Python 2 is EOL, would you allow the codebase to evolve to be only Python 3 compliant? Any plans or objections to a migration?
You know you can make in-line type hints Python 2 compatible: https://gitlab.com/m2crypto/m2crypto/-/blob/master/M2Crypto/BN.py (https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code)
That's convenient, but I'd actually prefer the direct inline annotations and dropping Python 2 support to the # type: ...
comments described in that pep.
It'd be great to have a typeshed stub for enhanced build-time correctness validation with mypy, pyre-check, and the like.