From 2a96e50c8cf324ac5c96e9a677f8376bd8740e56 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Sun, 8 Oct 2017 13:37:03 +0200 Subject: [PATCH] Sync with #4072 for realz --- mypy/checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/checker.py b/mypy/checker.py index 6cb9311ab8f5..06b9f8d4e9cb 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -2884,7 +2884,7 @@ def builtin_item_type(tp: Type) -> Optional[Type]: return tp.args[0] elif isinstance(tp, TupleType) and all(not isinstance(it, AnyType) for it in tp.items): return join_type_list(tp.items) - elif isinstance(tp, TypedDictType) and tp.fallback.type.fullname() == 'typing.Mapping': + elif isinstance(tp, TypedDictType): # TypedDict always has non-optional string keys. if tp.fallback.type.fullname() == 'typing.Mapping': return tp.fallback.args[0]