Skip to content

Renaming: Named tuple fields #3349

@MichaReiser

Description

@MichaReiser

Summary

Renaming a named tuple field misses the keyword arguments in constructor calls:

from typing import NamedTuple

class Point(NamedTuple):
    x: int
    y: int

point = Point(x=1, y=2)
print(point.x)

ty correctly renames the use of x in print(point.x) but it fails to rename the keyword argument in Point(x=1, ...).

Playground

Related to #3348

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserverRelated to the LSP server

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions