Skip to content

--fastparser + --py2 - leads to mypy thinking -1 is out of range for a tuple #1788

Closed
@OrenLeaffer

Description

@OrenLeaffer

The test case for this is pretty simple, access the last element of a tuple using -1.

$ cat t.py
(1,)[-1]
$ python2.7 t.py
$ python3.5 t.py
$ mypy --py2  --fast-parser t.py
t.py:1: error: Tuple index out of range
$ mypy --fast-parser t.py
$ mypy --py2 t.py
$

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions