From 1f9a1c025c92394d00b19183981943580375f218 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Thu, 29 Sep 2022 01:32:39 -0700 Subject: [PATCH] Rebase and update comment --- mypy/semanal_typeddict.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mypy/semanal_typeddict.py b/mypy/semanal_typeddict.py index 0c161c9f183d..696ce2da4894 100644 --- a/mypy/semanal_typeddict.py +++ b/mypy/semanal_typeddict.py @@ -298,7 +298,12 @@ def analyze_typeddict_classdef_fields( # NamedTupleAnalyzer doesn't and instead has semanal.py set it # by calling analyze_class_body_common after. # - # TODO: Resolve this inconsistency? + # This is because unlike TypedDicts, NamedTuples support method + # definitions. So, we must handle some of what analyze_class_body_common + # does here -- including modifying `stmt.type`. + # + # TODO: Find some way of refactoring and partially unifying + # these two codepaths? stmt.type = analyzed types.append(analyzed) # ...despite possible minor failures that allow further analyzis.