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
I understand this behavior may be surprising, but this is not a bug actually. This behavior is consistent with how e.g. regular type variables (and other types) always behaved with no-strict-optional, see #15932 where this was originally reported. ParamSpec was accidentally special.
Note this flag doesn't mean "do not report errors related to None in this file" (because it is actually not a well defined thing), but rather "in this file None is considered as subtype of all types".
Activity
[-][regression] Files with mixed `strict-optional` forget None'abe argument (with ParamSpec decorator)[/-][+][regression] Files with mixed `strict-optional` forget None'able argument (with ParamSpec decorator)[/+]ilevkivskyi commentedon Oct 11, 2023
I understand this behavior may be surprising, but this is not a bug actually. This behavior is consistent with how e.g. regular type variables (and other types) always behaved with
no-strict-optional, see #15932 where this was originally reported.ParamSpecwas accidentally special.Note this flag doesn't mean "do not report errors related to
Nonein this file" (because it is actually not a well defined thing), but rather "in this fileNoneis considered as subtype of all types".intgr commentedon Oct 13, 2023
Fair enough, this can be solved on my end by migrating more files to
strict_optional=true.