rope icon indicating copy to clipboard operation
rope copied to clipboard

rope-auto-import prefers private implementation modules over public interfaces, should inspect __all__ "moves"

Open glyph opened this issue 7 years ago • 0 comments

A common pattern in Python libraries is to have

# foo/_implementation.py
class MyClass: ...
# foo/__init__.py
from ._implementation import MyClass
__all__ = [
    "MyClass"
]

to define an explicit public API. Rope's auto-import functionality will prefer to import foo._implementation.MyClass and will not see foo.MyClass at all.

glyph avatar May 25 '18 20:05 glyph