Skip to content

typing the numbers module #47

Open
@MarcoGorelli

Description

@MarcoGorelli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions