-
Notifications
You must be signed in to change notification settings - Fork 276
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
Pyright flags load
as reportPrivateImportUsage
#4683
Comments
Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue. |
It is exported in Lines 78 to 79 in 416a6a4
Maybe the flagging is caused by the |
I think it's that pyright still considers those imports private, I think we'd need to change all the https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface doesn't explicitly state that but if you search for EDIT: this is one of the clearer discussions of it, microsoft/pyright#2639 |
I'm not sure I would like to see this change made at this time. It seems rather large, and also outside of our typical CI/lint/style stuff. |
EDIT: I saw that @chrishavlin proposed this already. @matthewturk this might make for a fairly inconsequential change? |
from https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
Today I learned. This is the opposite of what I thought type-checkers did. It actually makes more sense, as it's more conservative than the alternative (it's supposed to be possible to introduce type-checking gradually). If we were to explicitly declare our public API in the whole code base, I would prefer using |
I wouldn't mind a PR adding |
If adding |
OK, I have come around. It's not that big a deal to change, and probably having |
Bug report
Bug summary
Pyright flags any usage of
load
asreportPrivateImportUsage
. I believe it's becauseload
and other such functions are not exported as public inyt/__init__.py
.Code for reproduction
Example
pyproject.toml
withpoetry
-controlled deps:Error can be reproduced with the following snippet:
poetry run pip freeze
output:Actual outcome
Expected outcome
No error from
pyright
.Version Information
The text was updated successfully, but these errors were encountered: