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.
I have code equivalent to the following:
mypydoes not error.My environment has:
mypy==1.5.1types-requests==2.31.0.2At runtime I get:
I would expect an
[operator]error. For example, if I swap theCaseInsensitiveDict()for1, I get: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.