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

document that sync_imports() can't handle "import foo as bar" #1598

Closed
fperez opened this issue Apr 15, 2012 · 3 comments
Closed

document that sync_imports() can't handle "import foo as bar" #1598

fperez opened this issue Apr 15, 2012 · 3 comments

Comments

@fperez
Copy link
Member

fperez commented Apr 15, 2012

Consider (this assumes a cluster is up and running):

from IPython.parallel import Client
rc = Client()
dv = rc[:]
with dv.sync_imports():
    import numpy as np

a user would assume then that np would be defined in the engines, but it's not.

@minrk
Copy link
Member

minrk commented Apr 15, 2012

as discussed on IRC, the as foo part of import statements appears to actually be handled entirely outside the import machinery, and thus not accessible to a clean import hook / override. Some ugly frame inspection or similar would be required, so we have no plans to fix this for the time being, other than saying "you can't do that :(".

@fperez
Copy link
Member Author

fperez commented Apr 15, 2012

I think we can close this issue once we add a simple .. warning:: block to the docs pointing this limitation out.

@fperez
Copy link
Member Author

fperez commented Apr 15, 2012

I've changed the label to simply docs since it's really a language limitation, not a bug on our side.

@minrk minrk closed this as completed in 5fbdbb2 Jun 12, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
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