]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-103066: Add links and `help` in site.py constants (GH-103777) (#123763)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 6 Sep 2024 08:08:32 +0000 (10:08 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Sep 2024 08:08:32 +0000 (11:08 +0300)
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>
Doc/library/constants.rst
Doc/library/site.rst

index 93a7244f87de6b963c92bbc40e1dc2bdb78b90e3..3eceecc4e0a736913b295a42f3e8e6a520d30431 100644 (file)
@@ -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
 
index f5cf81fb1c9a171a7739e0f616b0101422973684..514eed314ea65f4d7b4a9f9b2ae258b6f226ebff 100644 (file)
@@ -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.