Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 837d6a0

Browse files
committedNov 30, 2021
Add comments
1 parent 80359a1 commit 837d6a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎mypy/checkexpr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4037,6 +4037,9 @@ def is_valid_keyword_var_arg(self, typ: Type) -> bool:
40374037
is_subtype(typ, self.chk.named_type('typing.Mapping')) and
40384038
try_getting_str_literals_from_type(map_instance_to_supertype(
40394039
typ, mapping_type.type).args[0]) is not None) or
4040+
# This condition is to avoid false-positive errors when empty dictionaries are
4041+
# passed with double-stars (e.g., **{})。The type of empty dicts is inferred to be
4042+
# dict[<nothing>, <nothing>], which is not a subtype of Mapping[str, Any]。
40404043
is_subtype(typ, self.chk.named_generic_type('typing.Mapping',
40414044
[UninhabitedType(), UninhabitedType()])) or
40424045
isinstance(typ, ParamSpecType)

0 commit comments

Comments
 (0)
Please sign in to comment.