The following code should successfully type check:
from werkzeug.datastructures import TypeConversionDict
d: TypeConversionDict[str, str] = TypeConversionDict()
x: int = d.get("a", default=1, type=int)
However, mypy gives an error:
$ mypy test.py
test.py:4: error: Incompatible types in assignment (expression has type "Optional[int]", variable has type "int")
Found 1 error in 1 file (checked 1 source file)
Environment:
- Python version: 3.8.5
- Werkzeug version: 2.1.0.dev0
The following code should successfully type check:
However, mypy gives an error:
Environment: