Skip to content

Mypy doesn't handle namedtuples with dynamic fields #848

@agentydragon

Description

@agentydragon

Given:

A = ['x']
T = namedtuple('T', A)

We get: error: List literal expected as the second argument to namedtuple(). Mypy should be able to handle this somehow, e.g., by allowing any operation on T instances if the second argument to namedtuple is not a list literal.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions