Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting typeshed stub #26

Open
matthewspeck opened this issue May 30, 2018 · 8 comments
Open

Requesting typeshed stub #26

matthewspeck opened this issue May 30, 2018 · 8 comments

Comments

@matthewspeck
Copy link

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

@kquick
Copy link
Owner

kquick commented May 31, 2018

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

@matthewspeck
Copy link
Author

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

@mcepl
Copy link

mcepl commented Jan 6, 2020

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
Copy link

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
Copy link
Owner

kquick commented Dec 17, 2020

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

@kquick
Copy link
Owner

kquick commented Dec 17, 2020

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

@mcepl
Copy link

mcepl commented Dec 17, 2020

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
Copy link
Owner

kquick commented Dec 17, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants