8000
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 ef4d492 commit 1f9a1c0Copy full SHA for 1f9a1c0
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