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
Fix inference of protocol against overloaded function (#12227)
We used to infer a callable in a protocol against all overload
items. This could result in incorrect results, if only one
of the overload items would actually match the protocol.
Fix the issue by only considering the first matching overload
item.
This seems to help with protocols involving `__getitem__`.
In particular, this fixes regressions related to
`SupportsLenAndGetItem`, which is used for `random.choice`.
0 commit comments