Closed
Description
Bug Report
from typing import NamedTuple
class RaggedFeature(NamedTuple):
class RowSplits(NamedTuple):
x: int
splits: RowSplits
produces an error message of,
Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]"
Expected Behavior
No error. I ran into this writing stubs for real code from here that does use nested namedtuples at runtime. It also type checks fine in pyright. Minor though as type: ignore seems to work fine for it in typeshed.
Your Environment
Latest mypy version 1.2. Default flags/configuration is enough.