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

Switch between completing everything and only names in __all__ in from imports #11

Closed
tek opened this issue Sep 12, 2012 · 5 comments
Closed

Comments

@tek
Copy link
Contributor

tek commented Sep 12, 2012

When completing here
from pkg.mod import <tab>
make it possible to only display names present in the module's __all__ list.
Realize this as a mapping, maybe only present when the popupmenu is open (toggle).

@tek
Copy link
Contributor Author

tek commented Sep 12, 2012

I'll try this myself if I find the time, just wanted to write down the idea :)

@davidhalter
Copy link
Owner

First, the example you give is not correct, because __all__ only affects star imports: from pkg.mod import *. Because you didn't know this, some of the stuff below might not be intended for you to hear. It's just to gather my thoughts.

That said, it is important to note that star imports are not that important, actually I think you shouldn't use it at all (which you are not saying of course).

I once wanted to check for __all__, but then I noticed, that it is really difficult with numpy, because there are additions on add, etc. So I guess the chance that jedi misses some entries, because understanding array operations is pretty heavy, is just too big for me.
However, if anyone wants to add this feature, the condition is that numpy is still fully functional with jedi.

@tek
Copy link
Contributor Author

tek commented Sep 12, 2012

I'm well aware of how __all__ works ;)
The reason for this feature suggestion is that I want be able to filter out the names that aren't in the public interface, i.e. the names not in __all__. For example, I've got the variable __copyright__ in every file and all names imported into a module always appear in the completion menu. So I think it would be a nice side effect of defining __all__ despite the encouragement on * imports.

@davidhalter
Copy link
Owner

Yeah, probably you're right. It could be an option in settings.py! I would probably make it the default. But to do this, numpy has to be taken care of. (It's not on my todo list at the moment, though.)

@davidhalter
Copy link
Owner

I'm closing this because of no activity and the lack of interest in the community (I myself am not interest in this option anyway and think that it's hard to do with Jedi).

However if somebody wants to do that. Feel free.

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

No branches or pull requests

2 participants