Skip to content

Handling Type Errors From Standard Library numbers #5649

Closed
@ImplyingICheck

Description

@ImplyingICheck

Is your feature request related to a problem? Please describe.
The problem lies with _typeshed, not with pyright.

The numbers module is not meant to be used for typing. Since numbers is a part of the standard library, users of static type checkers might expect an ABC class to work for typing (at least I would).

Describe the solution you’d like
Would it make sense to display some form of warning when a type error arises from a numbers meta class? For reference, mypy currently implements this behaviour.

Another alternative, or potentially an additional change, would be to have a note about this in the pyright documentation.

Does this seem to be reasonable behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions