diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-09-06 08:08:29 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-06 08:08:29 (GMT) |
| commit | 37e1f8d2a06ca098fd38dfeb148712dcccf5835d (patch) | |
| tree | e33cc1e081adf012314273724d08110497b5f913 | |
| parent | 8ed77c1afc125035996d85d77919351ae0f0d862 (diff) | |
| download | cpython-37e1f8d2a06ca098fd38dfeb148712dcccf5835d.zip cpython-37e1f8d2a06ca098fd38dfeb148712dcccf5835d.tar.gz cpython-37e1f8d2a06ca098fd38dfeb148712dcccf5835d.tar.bz2 | |
[3.13] gh-103066: Add links and `help` in site.py constants (GH-103777) (#123762)
Co-authored-by: David Caron <dcaron05@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
| -rw-r--r-- | Doc/library/constants.rst | 9 | ||||
| -rw-r--r-- | Doc/library/site.rst | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 93a7244..3eceecc 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -79,6 +79,8 @@ A small number of constants live in the built-in namespace. They are: :exc:`SyntaxError`), so they can be considered "true" constants. +.. _site-consts: + Constants added by the :mod:`site` module ----------------------------------------- @@ -94,6 +96,13 @@ should not be used in programs. (i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the specified exit code. +.. data:: help + :noindex: + + Object that when printed, prints the message "Type help() for interactive + help, or help(object) for help about object.", and when called, + acts as described :func:`elsewhere <help>`. + .. data:: copyright credits diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 871cfef..4508091 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -15,8 +15,9 @@ import can be suppressed using the interpreter's :option:`-S` option. .. index:: triple: module; search; path -Importing this module will append site-specific paths to the module search path -and add a few builtins, unless :option:`-S` was used. In that case, this module +Importing this module normally appends site-specific paths to the module search path +and adds :ref:`callables <site-consts>`, including :func:`help` to the built-in +namespace. However, Python startup option :option:`-S` blocks this and this module can be safely imported with no automatic modifications to the module search path or additions to the builtins. To explicitly trigger the usual site-specific additions, call the :func:`main` function. |
