ParamSpec
erases Optional
when no-strict-optional
is enabled
#15932
Labels
ParamSpec
erases Optional
when no-strict-optional
is enabled
#15932
Bug Report
The latest master will cause
ParamSpec
to replace parameters with typeOptional[T]
with typeT
when in a file withno-strict-optional
. This is different from the behavior on 1.5.1. While this is equivalent within the same file, if a function affected by this issue is imported to a file withoutno-strict-optional
, mypy will no longer let you passNone
into that parameter. This behavior affects decorators such ascontextlib.contextmanager
.To Reproduce
https://gist.github.com/mypy-play/dc17766e33ca6f4a1ec440257b0462ac
Expected Behavior
Actual Behavior
Your Environment
I bisected the commits and found that this issue first occurs on 14418bc.
The text was updated successfully, but these errors were encountered: