Skip to content
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

implicit namespace packages #959

Closed
fkloosterman opened this issue Aug 28, 2017 · 4 comments
Closed

implicit namespace packages #959

fkloosterman opened this issue Aug 28, 2017 · 4 comments
Labels

Comments

@fkloosterman
Copy link

According to the documentation, support for implicit namespace packages (Python 3.3+, PEP 420) is currently not implemented. As I am making heavy use of implicit namespace packages, I would really like to see jedi support this. Is there a plan or already work done to add support for this feature in the near future? If not, I can try myself if someone can point me to the relevant code.

@davidhalter
Copy link
Owner

I'm not planning to support this for now, because I'm not using it myself, currently (I'm working a lot with mixed Py2/3 code bases). I would like to see this implemented as well.

Implicit namespace packages will not be extremely easy to add I think. You probably have to touch jedi.evaluate.imports and maybe the jedi._compatibility module. I'm not really sure how I would tackle this one.

@davidhalter
Copy link
Owner

davidhalter commented Aug 28, 2017

Maybe also related: #122.

@fkloosterman
Copy link
Author

The Importer class uses pkgutil.iter_modules to discover packages, but this function explicitly looks for a init.py (see also this issue in the python bug tracker: https://bugs.python.org/issue29258). I suppose, jedi could either provide its own enhanced version of pkgutil.iter_modules, or wait until the pkgutil issue gets resolved upstream.

@davidhalter
Copy link
Owner

or wait until the pkgutil issue gets resolved upstream.

That's probably not possible, because that bug is not going into 2.7 and I'm thinking that it's probably also only fixed for 3.6+ and maybe 3.5. This means that it's going to take a long time until namespace packages would actually be working generally in Jedi. Like 5 years until these versions are not really used/supported anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants