Skip to content

Import completion advanced. #48

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

Open
ikanobori opened this issue Jul 4, 2014 · 7 comments
Open

Import completion advanced. #48

ikanobori opened this issue Jul 4, 2014 · 7 comments

Comments

@ikanobori
Copy link
Contributor

It was mentioned in the IRCtubes that it would be very nice to have completion on (for instance)

from datetime import xyz

import datetime.xyz

Where xyz would complete.


@ikanobori
Copy link
Contributor Author

<> makes import completion return "import " instead of "import".


Original Comment By: Andreas Stührk

@ikanobori
Copy link
Contributor Author

<> makes import completion smarter when the module is already in sys.path.


Original Comment By: Andreas Stührk

@ikanobori
Copy link
Contributor Author

Issue #96 was marked as a duplicate of this issue.


Original Comment By: Andreas Stührk

@ikanobori
Copy link
Contributor Author

Good luck Andy.


Original Comment By: Simon de Vlieger

@ikanobori
Copy link
Contributor Author

I'd really like to see this feature implemented. For example, in my django projects I often have lots of classes in one file... instead of digging through my files looking for the right imports, maybe bpython could show me a nice box with all the classes in that file.


Original Comment By: Anonymous

@thomasballinger
Copy link
Member

It sounds like #96 was not implemented because importing a module before the user hits enter didn't feel right. We have import completion on both of

from datetime import xyz
import datetime.xyz

if datetime has already been imported (note that the second syntax only autocompletes modules inside of the datetime package, or which there aren't any, so datetime is a bad example.

If we're ok with rooting around through modules (maybe with ast.py?) then this can stay open - otherwise it seems impossible given we don't want to run the code in the module.

@thomasballinger
Copy link
Member

IPython imports the module on pressing tab at a prompt like >>> from numpy import <tab>. This can lock up the console if importing something large or trigger side effects.

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