-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Tuple slicing is not supported #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, mypy should support this, obviously. Not sure why it got broken, though (or why it used to work). I think that this needs to be fixed in |
Basic support for this is now in (by @jhance). I'm leaving this open for now as a few additional things would be nice to have:
|
I firmly believe this is evil. Having Then again I hate the idea of variable-length homogenous tuples so I think my opinions on this are probably irrelevant. |
There are plenty of ways to get the same object with a different type, there is nothing evil about that. |
Its not about the fact that I get the same object with a different type, its the fact that I'm allowed to:
|
But even if you don't intend to get a homogenous tuple, you'll just get an error a little bit later. |
mypy -c 'v = (1, 2, 3); major, minor = v[:2]'
<string>:1: error: Tuple index must an integer literal
Oddly, this was not a failure before I rebased my branch.
The text was updated successfully, but these errors were encountered: