one more subtlety

This commit is contained in:
Just van Rossum 2002-12-26 19:03:22 +00:00
parent a83a6e2b05
commit 66feff0738
1 changed files with 4 additions and 4 deletions

View File

@ -199,10 +199,10 @@ Specification part 1: The Importer Protocol
module named "spam.eggs". If that fails, the import continues as an
absolute import: it will look for a module named "eggs". Dotted
name imports work pretty much the same: if package "spam" does
"import eggs.bacon" (and "spam.eggs" exists), "spam.eggs.bacon" is
tried and if that fails "eggs.bacon" is tried. (There are more
subtleties that are not described here, but these are not relevant
for implementers of the Importer Protocol.)
"import eggs.bacon" (and "spam.eggs" exists and is itself a
package), "spam.eggs.bacon" is tried. If that fails "eggs.bacon" is
tried. (There are more subtleties that are not described here, but
these are not relevant for implementers of the Importer Protocol.)
Deeper down in the mechanism, a dotted name import is split up by
its components. For "import spam.ham", first an "import spam" is