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

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

Projects

None yet

2 participants

Owner
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.

Owner
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 :(".

Owner
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.

Owner
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 added a commit that closed this issue Jun 12, 2012
@minrk minrk add note about sync_imports
closes #1598
5fbdbb2
@minrk minrk closed this in 5fbdbb2 Jun 12, 2012
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@minrk minrk add note about sync_imports
closes #1598
5c3b5a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment