From: David Caron Date: Fri, 6 Sep 2024 07:29:28 +0000 (-0400) Subject: gh-103066: Add links and `help` in site.py constants (#103777) X-Git-Tag: v3.14.0a1~568 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67957ea77da8c667df1508a9d3d9b39e59f671d6;p=thirdparty%2FPython%2Fcpython.git gh-103066: Add links and `help` in site.py constants (#103777) Co-authored-by: Terry Jan Reedy Co-authored-by: Ɓukasz Langa Co-authored-by: Serhiy Storchaka Co-authored-by: Alex Waygood --- diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 6c1063cda669..04bb8c51a3b1 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -82,6 +82,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 ----------------------------------------- @@ -97,6 +99,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 `. + .. data:: copyright credits diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 871cfefc8de3..4508091f679d 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 `, 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.