Skip to content

literal NamedTuple as a type #10294

Closed
Closed
@belm0

Description

@belm0

Pitch

I have an API that accepts dynamically created NamedTuple types. I'd at least like to specify NamedTuple as a type hint, and have mypy allow any attribute access on top of Tuple operations. The infinitely wider scope of Any isn't too attractive. (Is there something else suitable from typing that I'm missing?)

error: "NamedTuple" has no attribute "x"  [attr-defined]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions