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
Type error in Pylance #3348
Comments
Ah, it might want us to prefix the pos-only argnames with an underscore? Or it might be some other issue that we can solve locally. Thanks for the report! |
If I had to guess, it's because of the I think this should be pushed to Pylance/Pyright: I've edited the issue to precise that the analysis mode is strict. |
Ah, if you've got the same error from Numpy then it probably does make sense to treat it as a pyright issue, since I'm pretty sure it's pyright rather than pylance. Do you want to open that upstream, and tag me? |
I don't think that there is a problem with pyright here. This is fixed by updating both lines 110 and 116 in def tuples(*args: SearchStrategy[Any]) -> SearchStrategy[Tuple[Any, ...]]: # noqa: F811 |
@rsokl Cool! so |
Specifying Similarly, e.g., And, for some reason, pyright-strict expects that the actual implementation (line 116) to also include annotations, even though this seems to be redundant with the lowest overload. I haven't taken the time to see if mypy wants the same. @Zac-HD I can try to fix this sometime today. Would you also like me to make the overloads use pos-only args ( |
Thanks! Yeah, let's also use pos-only args - they are in fact positional-only, so. |
For the record, the same issue occurs in |
This is with
Pylance language server 2022.5.1 (pyright e0e07d31)
, Python3.10
and hypothesis6.46.5
Edit: the analysis mode is strict:
The following snippet:
fails to typecheck with:
I'd be happy to push this myself to the
pylance
issues if I'm advised to!The text was updated successfully, but these errors were encountered: