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 2451c0c commit 63c1080Copy full SHA for 63c1080
mypy/semanal_typeddict.py
@@ -298,7 +298,12 @@ def analyze_typeddict_classdef_fields(
298
# NamedTupleAnalyzer doesn't and instead has semanal.py set it
299
# by calling analyze_class_body_common after.
300
#
301
- # TODO: Resolve this inconsistency?
+ # This is because unlike TypedDicts, NamedTuples support method
302
+ # definitions. So, we must handle some of what analyze_class_body_common
303
+ # does here -- including modifying `stmt.type`.
304
+ #
305
+ # TODO: Find some way of refactoring and partially unifying
306
+ # these two codepaths?
307
stmt.type = analyzed
308
types.append(analyzed)
309
# ...despite possible minor failures that allow further analyzis.
0 commit comments