-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Issue with builtins.slice Signature #832
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
I think you can just submit a PR to fix this. I expect that the attributes should also be Optional[int]? There are also two issues discussing bigger changes to slice, but I think they are somewhat controversial: |
Righto. I have not done a pull request before, so time to go learn about that. |
Looks like this can be closed since the PR was merged. |
Which makes me think, reviewers should be more careful to edit the commit summary, message body, and auto-close text (preferably "fixes #x" or "closes #x" -- the latter if it's not really a fix but e.g. a feature request). |
I have been trying mypy out, and I am hitting something I don't understand. I have the following line of code:
When I run mypy over it I get the following error (in python3.5 virtualenv):
It seems that slice has a type signature of slice(int, int, int), but to get the behavior I want (give me everything in the string after the third character) I need to pass in a None. I think they should be Optional[int]s rather than ints.
Hopefully that makes sense.
The text was updated successfully, but these errors were encountered: