Skip to content
Discussion options

You must be logged in to vote

You've uncovered a subtle difference in behavior between mypy and pyright that I hadn't previously noticed. It occurs in the case where you use an unpacked dict argument and the target call has keyword parameters with default arguments. Pyright's behavior assumed that such parameters would be supplied their argument from the default, so it was OK if the unpacked dict type was incompatible. Mypy apparently assumes that the unpacked dict may contain entries that correspond to all otherwise-unmatched keyword parameters, so the supplied type within the dict must be compatible with these keyword parameters even if they have a default argument value.

This affects the overload behavior because y…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ringohoffman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants