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 doesn't handle out-of-order kwargs for callable protocol #15984
This didn't happen on the last release, and in fact didn't happen as recently as 5d909f1. It does seem to happen only for callable protocols and not for functions.
Actual Behavior
main.py:12: error: Argument 1 to "g" has incompatible type "A"; expected "Callable[[int, str], None]" [arg-type]
main.py:12: note: "A.__call__" has type "Callable[[Arg(str, 'x'), Arg(int, 'y')], None]"
Yeah, this is caused by my PR. I will take a look later today (It is sad we don't have something like get_proper_type() and plugin for CallableType, maybe we should write one, but I guess it may be a pain to use, since we don't have checkmember infra available in many places, so it comes back again to #7724)
Activity
ilevkivskyi commentedon Aug 29, 2023
Yeah, this is caused by my PR. I will take a look later today (It is sad we don't have something like
get_proper_type()and plugin forCallableType, maybe we should write one, but I guess it may be a pain to use, since we don't havecheckmemberinfra available in many places, so it comes back again to #7724)Fix ParamSpec inference for callback protocols (#15986)
Fix ParamSpec inference for callback protocols (#15986)