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
Wrong overload resolution with alias to Any #15630
Overload resolution appears to pick the first matching overload if the argument type is an alias to Any. It should consider all overloads. This works correctly when using Any directly (without an alias). This came up in python/typeshed#10405.
Activity
AlexWaygood commentedon Jul 9, 2023
Adding
reveal_typecalls to the example confirms that mypy is picking a different overload with the alias-to-Any version: https://mypy-play.net/?mypy=latest&python=3.11&flags=strict&gist=8b3429d9daae0e46ebc64d5aae592513Add practical python#21768 tests and changelog after version audit
Count Any inside type aliases for overload ambiguity