bpo-31582: Created a new documentation section describing sys.path initialization (GH-31082)

This commit is contained in:
Russel Webber 2022-03-23 17:29:40 +00:00 committed by GitHub
parent fe010605f8
commit c62b944dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 128 additions and 29 deletions

View file

@ -1124,15 +1124,16 @@ always available.
current directory first. Notice that the script directory is inserted *before*
the entries inserted as a result of :envvar:`PYTHONPATH`.
The initialization of :data:`sys.path` is documented at :ref:`sys-path-init`.
A program is free to modify this list for its own purposes. Only strings
and bytes should be added to :data:`sys.path`; all other data types are
ignored during import.
.. seealso::
Module :mod:`site` This describes how to use .pth files to extend
:data:`sys.path`.
* Module :mod:`site` This describes how to use .pth files to
extend :data:`sys.path`.
.. data:: path_hooks