8000 [3.13] gh-103066: Add links and `help` in site.py constants (GH-10377… · python/cpython@37e1f8d · GitHub
[go: up one dir, main page]

Skip to content

Commit 37e1f8d

Browse files
miss-islingtondavidcaronterryjreedyambvserhiy-storchaka
authored
[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>
1 parent 8ed77c1 commit 37e1f8d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Doc/library/constants.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ A small number of constants live in the built-in namespace. They are:
7979
:exc:`SyntaxError`), so they can be considered "true" constants.
8080

8181

82+
.. _site-consts:
83+
8284
Constants added by the :mod:`site` module
8385
-----------------------------------------
8486

@@ -94,6 +96,13 @@ should not be used in programs.
9496
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
9597
specified exit code.
9698

99+
.. data:: help
100+
:noindex:
101+
102+
Object that when printed, prints the message "Type help() for interactive
103+
help, or help(object) for help about object.", and when called,
104+
acts as described :func:`elsewhere <help>`.
105+
97106
.. data:: copyright
98107
credits
99108

Doc/library/site.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import can be suppressed using the interpreter's :option:`-S` option.
1515

1616
.. index:: triple: module; search; path
1717

18-
Importing this module will append site-specific paths to the module search path
19-
and add a few builtins, unless :option:`-S` was used. In that case, this module
18+
Importing this module normally appends site-specific paths to the module search path
19+
and adds :ref:`callables <site-consts>`, including :func:`help` to the built-in
20+
namespace. However, Python startup option :option:`-S` blocks this and this module
2021
can be safely imported with no automatic modifications to the module search path
2122
or additions to the builtins. To explicitly trigger the usual site-specific
2223
additions, call the :func:`main` function.

0 commit comments

Comments
 (0)
0