Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,15 @@ shared libraries (e.g. ``.so`` files). When supported by the :mod:`zipimport`
module in the standard library, the default path entry finders also handle
loading all of these file types (other than shared libraries) from zipfiles.

Within a single :term:`path entry`, the default path entry finders check for a
:term:`regular package` first, then for extension modules, then for source
files, and finally for bytecode files. For example, if the same directory
contains both ``spam/__init__.py`` and ``spam.py``, ``import spam`` will
import the package from ``spam/__init__.py``. A directory without an
``__init__.py`` file is treated as a :term:`namespace package` portion only if
no matching module is found. Note that this does not override the order of the
:term:`import path`.

Path entries need not be limited to file system locations. They can refer to
URLs, database queries, or any other location that can be specified as a
string.
Expand Down
Loading