-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Discussion 🤔Needs triage 📥Just created, needs acknowledgment, triage, and proper labellingJust created, needs acknowledgment, triage, and proper labelling
Description
Bug description
# p1/__init__.py
class _Dummy:
pass
# p2/__init__.py
from p1 import _DummyConfiguration
[tool.pylint.master]
load-plugins = ["pylint.extensions.private_import",]Command used
pylint p1 p2Pylint output
************* Module p2
p2/__init__.py(3): [C2701(import-private-name)] Imported private object (_Dummy)Expected behavior
If a project has multiple roots, the check should understand this. Currently it's implemented using path compares in same_root_dir but I think we need a configuration in which I can supply my package roots. If any of them is the start f the import, the import should never be flagged
Pylint version
pylint 4.0.2
astroid 4.0.1
Python 3.14.0 (main, Nov 10 2025, 09:33:32) [GCC 7.5.0]OS / Environment
Linux
Additional dependencies
Metadata
Metadata
Assignees
Labels
Discussion 🤔Needs triage 📥Just created, needs acknowledgment, triage, and proper labellingJust created, needs acknowledgment, triage, and proper labelling