Jump to

v11-l1-import

Consider a pack Python package containing a mod module, which one of the following import statement is not allowed ?

import pack
import pack.mod
from pack import mod as m
import mod from pack 

???

Well, this is just how the Python syntax is defined : you can import a specific module from a package like this

from pack import mod

and even import it under a new name

from pack import mod as m

but the from always have to be before the import statement, so this is not allowed :

import mod from pack  # syntax error