Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Tuple[int, int] not unpacked correctly into lvar tuple #1457

@bvanrijn

Description

@bvanrijn

Description

In the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of a and b when hovering over them.

Minimal reproducible example

from typing import Tuple, List

def foo() -> List[Tuple[int, int]]:
    return [(1, -1)]

result = foo()
(a, b) = result[0]

Expected behavior

When hovering over a or b, I expect to see a: int and b: int.

Actual behavior

When hovering over a or b, it shows a: Tuple[int, int] and b: Tuple[int, int]. I also tested this using PyCharm CE and it correctly inferred the types (i.e. a: int and b: int).

System information

OS: macOS "Mojave" 10.14.6 (18G87)

Visual Studio Code

Python extension version: 2019.8.30787

Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions