[Python-Dev] How to block a module import

Nick Coghlan ncoghlan at gmail.com
Tue Jul 13 23:10:34 CEST 2010


> Nick's right; 0 fails on an import * to pull anything in of interest. And as
> I said on python-checkins -- you can ignore that email, Alexander -- there
> is a historical reason because in Python 2 if you tried an implicit relative
> import a value of None met to do an absolute import. This doesn't have that
> effect in py3k as explicit relative imports are the only way to do relative
> imports (and luckily importlib does the proper thing for this as well =).

Ah, thank you - I knew we had a reason for doing it that way, I just
couldn't remember what it was :)

@Alexander: yes, it should be changed to None for 2.7, 3.1 and 3.2,
since none of those allow implicit relative imports.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list