Skip to content

[red-knot] Support unpacking attribute assignments: self.x, self.y = … #15962

@sharkdp

Description

@sharkdp

The goal of this ticket is to get rid of the TODOs in this test, and support attribute assignments in tuple/list unpackings:

class C:
    def __init__(self) -> None:
        self.a, self.b = (1, "a")

c_instance = C()

reveal_type(c_instance.a)  # should be: Unknown | Literal[1]
reveal_type(c_instance.b)  # should be: Unknown | Literal["a"]

part of: #14164

Metadata

Metadata

Assignees

Labels

tyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions