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 was surprised about the cases (val2, val3, val6) where pyright infers Literal[1] and mypy infers Any. It's consistent with the rule that we pick the first overload that matches, but Michael's comment in python/typing#253 (comment) (the closest we have to a spec of how overload works in mypy) suggests to avoid matches due to Any. That's also what I'd expect as a user.
I'm curious what led you to pick pyright's behavior here; I couldn't find any mention of it in the documentation.
The text was updated successfully, but these errors were encountered:
There's been a similar issue before on overload ambiguity with Any and answer then is here, #2521 (comment) . Main reason is Any behaves poorly for IDE experience.
Consider this test case:
I was surprised about the cases (val2, val3, val6) where pyright infers Literal[1] and mypy infers Any. It's consistent with the rule that we pick the first overload that matches, but Michael's comment in python/typing#253 (comment) (the closest we have to a spec of how overload works in mypy) suggests to avoid matches due to Any. That's also what I'd expect as a user.
I'm curious what led you to pick pyright's behavior here; I couldn't find any mention of it in the documentation.
The text was updated successfully, but these errors were encountered: