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
{{ message }}
Repository navigation
ParamSpec erases Optional when no-strict-optional is enabled #15932
The latest master will cause ParamSpec to replace parameters with type Optional[T] with type T when in a file with no-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 without no-strict-optional, mypy will no longer let you pass None into that parameter. This behavior affects decorators such as contextlib.contextmanager.
Activity
ilevkivskyi commentedon Aug 22, 2023
This is consistent with behavior for regular
TypeVars (since at least 1.0.0, but likely it is much older):Unions were simplified during expansion for ages, and inconsistent behavior for
ParamSpecwas a bug.