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
When creating a helper function around a ParamSpec-based generic I recently stumbled upon a spurious "Incompatible return value type" error.
Mypy seems to (internally) represent CustomCallable[~P]-parametrized generics as CustomCallable[Callable[P, None]] instead of just CustomCallable[P]. This internal representation can be exposed in certain situations though, resulting in false positives such as in the example below.
This PR adds a new Parameters proper type to represent ParamSpec parameters
(more about this in the PR), along with supporting the Concatenate operator.
Closes#11833Closes#12276Closes#12257
Refs #8645
External ref python/typeshed#4827
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Bug Report
When creating a helper function around a
ParamSpec
-based generic I recently stumbled upon a spurious "Incompatible return value type" error.Mypy seems to (internally) represent
CustomCallable[~P]
-parametrized generics asCustomCallable[Callable[P, None]]
instead of justCustomCallable[P]
. This internal representation can be exposed in certain situations though, resulting in false positives such as in the example below.To Reproduce
Your Environment
mypy.ini
(and other config files): n.a.The text was updated successfully, but these errors were encountered: