Skip to content

pairwise loses type of items. #2641

@MentalMegalodon

Description

@MentalMegalodon

Summary

from itertools import pairwise

foo: list[int] = [0, 1, 2, 3]
for a, b in pairwise(foo):
    reveal_type(a) # Revealed type: `Unknown` (revealed-type) [Ln 5, Col 17]
    reveal_type(b) # Revealed type: `Unknown` (revealed-type) [Ln 6, Col 17]

Playground: https://play.ty.dev/f1e9e23c-993d-47b7-808c-1857fe6cc80a

Running mypy on the same program reveals ints as I would expect.

Image

Version

0.0.14

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions