Skip to content

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

Closed

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
$

Activity

  1. self-assigned this
    on Jul 1, 2016
  2. ddfisher commented on Jul 1, 2016

    @ddfisher
    Collaborator

    Thanks for the bug report! This should be fixed in typed-ast shortly.

  3. added a commit that references this issue on Jul 1, 2016
    e54f812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions