[IPython-dev] Editing manifest.in

Fernando Perez Fernando.Perez at colorado.edu
Sun Jan 22 15:40:13 EST 2006

Ville Vainio wrote:
> On 1/22/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>>No: the trick this relies on, which is that it says
>>import IPython
>>and since the 'IPython/' directory is directly below, it imports it right
>>away, will cease to work very soon:
> I don't think it will - the pep suggests that intra-package *module*
> imports will break. This script relies on the IPython *package* being
> under the current dir, and that will definitely continue working.
> Current-dir-in-pythonpath is not going away soon.

As I said before, in the absence of true symlinks on NTFS, go ahead with this.

But just out of understanding curiosity, the way I read the section titled 
"Guido's decision" on that pep, I do think that unqualified imports like  we 
use today will break _both_ for packages and modules.  At least that's how I 
understand this:

... following are correct usages of the new syntax:

from .moduleY import spam
from .moduleY import spam as ham
from . import moduleY
from ..subpackage1 import moduleY
from ..subpackage2.moduleZ import eggs
from ..moduleA import foo
from ...package import bar
from ...sys import path

Note that while that last case is legal, it is certainly discouraged ("insane" 
was the word Guido used).

Relative imports must always use from <> import; import <> is always absolute.


The examples they show all use the '.' import, which is why I'm thinking what 
I'm thinking.  But maybe I'm just confused...   That pep could be worded a 
little clearer, I think...


More information about the IPython-dev mailing list