kquick / Thespian

Python Actor concurrency library
MIT License
190 stars 24 forks source link

Requesting typeshed stub #26

Open matthewspeck opened 6 years ago

matthewspeck commented 6 years ago

It'd be great to have a typeshed stub for enhanced build-time correctness validation with mypy, pyre-check, and the like.

kquick commented 6 years ago

Great idea! If you had the time to contribute something like that I would definitely be interested.

matthewspeck commented 6 years ago

image Alright I'll take a stab at this :)

mcepl commented 4 years ago

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.

todd-cook commented 3 years ago

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?

kquick commented 3 years ago

@todd-cook I think it's reasonable to finally drop Python 2 support, so I have no objections to a migration.

kquick commented 3 years ago

I would also be open to type hints directly in the code, per @mcepl 's comment.

mcepl commented 3 years ago

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)

kquick commented 3 years ago

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.