We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba9380d commit 12db980Copy full SHA for 12db980
1 file changed
mypy/checkexpr.py
@@ -5434,7 +5434,10 @@ def visit_dict_expr(self, e: DictExpr) -> Type:
5434
if key is None:
5435
# This is a **expr unpacking. Check that the expression has string keys.
5436
value_type = get_proper_type(self.accept(value))
5437
- if not self.is_valid_keyword_var_arg(value_type):
+ # NEW: Allow Any or Unbound types to reduce false positives in external libraries
5438
+ if isinstance(value_type, (AnyType, UnboundType)):
5439
+ pass
5440
+ elif not self.is_valid_keyword_var_arg(value_type):
5441
is_mapping = is_subtype(
5442
value_type, self.chk.named_type("_typeshed.SupportsKeysAndGetItem")
5443
)
0 commit comments