{"action":"created","issue":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/899","labels_url":"https://api.github.com/repos/JukkaL/mypy/issues/899/labels{/name}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/899/comments","events_url":"https://api.github.com/repos/JukkaL/mypy/issues/899/events","html_url":"https://github.com/JukkaL/mypy/issues/899","id":110810556,"number":899,"title":"Allow non-literals when indexing uniform tuples","user":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars.githubusercontent.com/u/1107911?v=3","gravatar_id":"","url":"https://api.github.com/users/JukkaL","html_url":"https://github.com/JukkaL","followers_url":"https://api.github.com/users/JukkaL/followers","following_url":"https://api.github.com/users/JukkaL/following{/other_user}","gists_url":"https://api.github.com/users/JukkaL/gists{/gist_id}","starred_url":"https://api.github.com/users/JukkaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JukkaL/subscriptions","organizations_url":"https://api.github.com/users/JukkaL/orgs","repos_url":"https://api.github.com/users/JukkaL/repos","events_url":"https://api.github.com/users/JukkaL/events{/privacy}","received_events_url":"https://api.github.com/users/JukkaL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JukkaL/mypy/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-10T18:52:55Z","updated_at":"2015-10-10T18:53:23Z","closed_at":null,"body":"Currently mypy doesn't allow indexing fixed-length tuples using a non-literal index. We should probably support this at least for tuples with homogeneous types. \r\n\r\nFor example, code like this should probably be okay:\r\n\r\n```python\r\nt = (1, 3, 7)\r\nfor i in range(len(t)):\r\n    print(i, t[i])\r\n```\r\n\r\nThe example below is actually already valid so rejecting the above code is inconsistent (this works due to how we set the `fallback` attribute for tuples to be `Tuple[t, ...]`):\r\n\r\n```python\r\nt = (1, 2, 3)\r\nfor i, x in enumerate(t):\r\n    print(i, x)\r\n```"},"comment":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/comments/147116751","html_url":"https://github.com/JukkaL/mypy/issues/899#issuecomment-147116751","issue_url":"https://api.github.com/repos/JukkaL/mypy/issues/899","id":147116751,"user":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars.githubusercontent.com/u/1107911?v=3","gravatar_id":"","url":"https://api.github.com/users/JukkaL","html_url":"https://github.com/JukkaL","followers_url":"https://api.github.com/users/JukkaL/followers","following_url":"https://api.github.com/users/JukkaL/following{/other_user}","gists_url":"https://api.github.com/users/JukkaL/gists{/gist_id}","starred_url":"https://api.github.com/users/JukkaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JukkaL/subscriptions","organizations_url":"https://api.github.com/users/JukkaL/orgs","repos_url":"https://api.github.com/users/JukkaL/repos","events_url":"https://api.github.com/users/JukkaL/events{/privacy}","received_events_url":"https://api.github.com/users/JukkaL/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T18:53:23Z","updated_at":"2015-10-10T18:53:23Z","body":"The relevant bit of code is `visit_index_expr_helper` in `mypy/checkexpr.py`."}}