Skip to content

Support recursive definitions for functional namedtuples #2529

@charliermarsh

Description

@charliermarsh

E.g., Mypy and Pyright both support this:

from typing import NamedTuple

NT = NamedTuple("NT", [("field", "NT | int")])

NT(1)
NT(NT(0))
NT("foo")  # error

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions