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 424334a commit 80c1b38Copy full SHA for 80c1b38
mypy/checker.py
@@ -2886,7 +2886,10 @@ def builtin_item_type(tp: Type) -> Optional[Type]:
2886
return join_type_list(tp.items)
2887
elif isinstance(tp, TypedDictType) and tp.fallback.type.fullname() == 'typing.Mapping':
2888
# TypedDict always has non-optional string keys.
2889
- return tp.fallback.args[0]
+ if tp.fallback.type.fullname() == 'typing.Mapping':
2890
+ return tp.fallback.args[0]
2891
+ elif tp.fallback.type.bases[0].type.fullname() == 'typing.Mapping':
2892
+ return tp.fallback.type.bases[0].args[0]
2893
return None
2894
2895
0 commit comments