Skip to content

typing the numbers module #47

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

Open
MarcoGorelli opened this issue Mar 4, 2025 · 0 comments
Open

typing the numbers module #47

MarcoGorelli opened this issue Mar 4, 2025 · 0 comments

Comments

@MarcoGorelli
Copy link
Collaborator

Context: some types from NumPy show up as partially known in pyright --verifytypes because they use untyped parts of the Numbers module microsoft/pyright#9905

According to Jelle Zijlstra (Core developer for CPython, typing-extensions, typeshed, mypy, Black. Member of the Python Typing Council) in a comment on the Python Discourse, this module should not be typed:

There’s been a lot of discussion and attempts to make the numbers module work well with static typing (int is not a Number? · Issue #3186 · python/mypy · GitHub, previous typeshed PRs like int is not a Number? · Issue #3186 · python/mypy · GitHub and Further improve return types in the numbers module by AlexWaygood · Pull Request #11375 · python/typeshed · GitHub). My conclusion is that you should not use the numbers module with static typing and attempts to do so are likely to run into trouble.

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

No branches or pull requests

1 participant