-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overlap between TypedDict and Mapping (#7164)
Fixes #7036 This adds more "fine grained" logic for overlap between `TypedDict` and `Mapping` used by overload checks and `--strict-equality`. Basically the rules are: * A `TypedDict` with some required keys is overlapping with `Mapping[str, <some type>]` if and only if every key type is overlapping with `<some type>`. * A `TypedDict` with no required keys overlaps with `Mapping[str, <some type>]` if and only if at least one of key types overlaps with `<some type>`. * Empty dictionaries are as usual in gray area, so we follow the same logic as in other places: an empty dictionary can't cause an overlap (i.e. `TypedDict` with no required keys doesn't overlap with `Mapping[str, <some type>]`), but is itself (i.e. `Mapping[<nothing>, <nothing>]`) overlapping with a `TypedDict` with no required keys.
- Loading branch information
1 parent
e818a96
commit 8782d63
Showing
5 changed files
with
261 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters