Skip to content

bpo-38623: Add note about site module (site-packages) #16974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 23, 2021
Merged
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
3 changes: 2 additions & 1 deletion Doc/tutorial/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ named :file:`spam.py` in a list of directories given by the variable
file is specified).
* :envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the
shell variable :envvar:`PATH`).
* The installation-dependent default.
* The installation-dependent default (by convention including a
``site-packages`` directory, handled by the :mod:`site` module).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this is just a noise for tutorial readers.

We don't introduce even standard library (it is introduced in 6.2). So we shouldn't mention about what is in the "installation-dependent default" in this chapter. It should be just "some other directories" for the readers here.

If you really want to document site-packages, I think Python Setup and Usage or Installing Python Modules is better place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to the reader what "handled" means here. What would a reader of the tutorial do with the site module?

Copy link
Contributor Author

@bittner bittner Mar 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "taken care of [by ...]" be better, maybe? This is mainly a referral to the first paragraph of the site module documentation, which says:

This module is automatically imported during initialization.

The tutorial reader, which may be someone having landed here by organic search traffic (i.e. not necessarily a Python novice), may get a hint on what "installation-dependent default[s]" are (via "site-packages") and where to read more about it (via the link to the site module documentation).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess i don't understand why any reader needs to know what module placed site-packages into the import path? Just because someone might land on this page through a search doesn't mean we should add every fact to it. The tutorial should first and foremost be useful to read by beginners. This addition seems like a confusing addition.


.. note::
On file systems which support symlinks, the directory containing the input
Expand Down