You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
We generally don't create special cases for specific classes or modules. The bar for adding special cases is very high, and I don't think this situation meets the bar.
The normal error messages in pyright should suffice to explain to users why they are seeing a type violation error, even if such an error initially may seem surprising.
I recall only a couple of cases where the current error messages have resulted in errant bug reports or questions by pyright users, so I don't think this is a widespread problem. I might consider revisiting this issue in the future if I see such a pattern.
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?
The text was updated successfully, but these errors were encountered: