-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positive for shutil.rmtree
for python 3.12 with pyright 1.1.366
#8087
Comments
I don't believe this is an error as it's prepping for a python 3.14 update where the function will be removed. We should change our code or ignore the error and deal with it in a year when 3.14 comes out |
I don't think the function is going to be removed. I believe it's that the |
👍 Yes, agreed. |
Pyright is working correctly here, so I don't consider this a bug in pyright. If you think that the shutil.pyi type stub is incorrect, please report the issue to the maintainers of typeshed. |
Thanks, I've filed it at python/typeshed#12103. Note that I wasn't able to reproduce the issue with mypy, so it seems that pyright and mypy are handling overloads differently. |
Does mypy have support for PEP 702 ( I'll note that pyright doesn't emit any error or warning by default when using a Overload resolution behavior is not currently specified in the typing spec. But even if/when it is, there's still an ambiguity related to
But this wording doesn't seem to acknowledge that multiple overloads are sometimes used to resolve a single call. |
Just following up:
|
Consider the following file:
If I run
pyright
on it, it reports an error:I believe this is due in part to a recent change to the type stub, but it might also be due to how pyright matches
overload
s. The message seems to be intended for calls that provide a value for theonerror
parameter, but in the actual code, that isn't happening.The text was updated successfully, but these errors were encountered: