Skip to content

[red-knot] Infer slice expression types #13853

@sharkdp

Description

@sharkdp

Part of astral-sh/ty#244, and also #13689. Infer types for slice expressions.

  • x[1:3] should be inferred as tuple[str, str] if x has type tuple[int, str, str, int]
  • y[1:3] should be inferred as Literal["aa"] if y has type Literal["baab"].

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