SourcetrailPythonIndexer icon indicating copy to clipboard operation
SourcetrailPythonIndexer copied to clipboard

support for implicit namespace packages (pep 420)

Open Nurbel opened this issue 5 years ago • 2 comments

my project uses implicit namespace packages ( https://www.python.org/dev/peps/pep-0420/ ), which source trail does not seem to recognize.

For example, given this file structure: my_ns_package/subpackage/ init.py main.py other.py

I get errors in main.py when trying to import symbols from my_ns_package.subpackage.other ( "Imported symbol named "my_ns_package" has not been found.")

Is it something you plan to support?

Nurbel avatar Aug 25 '20 22:08 Nurbel

Hey @Nurbel. From within main.py you would just write import other, right?

mlangkabel avatar Sep 14 '20 14:09 mlangkabel

No, the subpackage directory is not in my python path. I could write from . import other or from .other import symbol. I guess in this example, I would call main with python -m my_ns_package.subpackage.main

Nurbel avatar Sep 14 '20 14:09 Nurbel