-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
question to the signature of list.index #134025
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 the typing issue you see was fixed in hauntsaninja/useful_types#23 last year. We could give |
Thanks for reply, but the SequenceNotStr is pandas._typing.SequenceNotStr, so it still not fix for me (its my wrong that not clearify which package the SequenceNotStr is provided). But I think this show that more third party typing system set the arguments as position-and-keyword, so this question may be more important than we think. |
Well, then this is a bug in pandas. |
even this is a bug and we keep old behaviour, maybe at least we should clearly set the argument type of this two parameters in python standard document to guild third party package what is the correct signature of index? |
@weipeng1999 Pardon my ignorance, but could you please include a code snippet that's causing pyright to emit that error? |
Closing, for help please use other fora. A |
Recently I switch to use pyright as my lsp server. This server is very strict at type annotation, and I found some errors as following.
so I check the "index" signature of list.index and SequenceNotStr.index, found that:
The signature of list.index make me surprised. Why we set start and stop as the position-only argument to the list.index? I think defined them as position-and-keyword argument is a better idea, so that we can using keyword to set them. Meanwhile i think give default value to position-only argument is a little strange
The text was updated successfully, but these errors were encountered: