Skip to content

False negative when using keyword argument for NamedTuple #5699

Closed

Description

The NamedTuple function does not support keyword parameters, so the following causes a runtime error. Pyright doesn't catch this currently.

from typing import NamedTuple

NT1 = NamedTuple(typename="NT1", fields=[("a", str), ("b", str)])

This is related to mypy issue python/mypy#8651.

Related to this, the namedtuple function does support keyword parameters, but pyright doesn't currently validate those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    addressed in next versionIssue is fixed and will appear in next published versionbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions