Extend reportPrivateImportUsage
to report use of symbols imported from private submodules in a "py.typed" library
#9008
Labels
enhancement request
New feature or request
Discussed in #9004
Originally posted by Delgan September 16, 2024
Hi.
I've read the docs about Library interface but I can't understand why isn't
pyright
reporting an error when I import private modules.Consider first installing a third-party library like
pydantic
:Then asking
pyright
to analyze the following file in "strict" mode:Because I'm importing and using
_migration
which is supposed to be a private module, I would expect an error such asreportPrivateUsage
orreportPrivateImportUsage
. However, the output is (for version 1.1.380):Is that intentional design? I understand that for unit tests within the library, it's preferable for library authors to be able to import a private module (and test some internal functions). But shouldn't this be forbidden for a library user?
The text was updated successfully, but these errors were encountered: