-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: false negativeType checkers do not report an error, but shouldType checkers do not report an error, but should
Description
I have code equivalent to the following:
from requests.structures import CaseInsensitiveDict
CaseInsensitiveDict() | dict()
mypy
does not error.
My environment has:
mypy==1.5.1
types-requests==2.31.0.2
- Python 3.11.5
At runtime I get:
TypeError: unsupported operand type(s) for |: 'CaseInsensitiveDict' and 'dict'
I would expect an [operator]
error. For example, if I swap the CaseInsensitiveDict()
for 1
, I get:
error: Unsupported operand types for | ("int" and "dict[str, str]") [operator]
I am happy to contribute, but I'm not sure what change is needed. I imagine a change is needed in https://github.com/python/typeshed/blob/main/stubs/requests/requests/structures.pyi.
Metadata
Metadata
Assignees
Labels
stubs: false negativeType checkers do not report an error, but shouldType checkers do not report an error, but should