Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67957ea

Browse filesBrowse files
davidcaronterryjreedyambvserhiy-storchakaAlexWaygood
authored
pythongh-103066: Add links and help in site.py constants (python#103777)
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 d359c7c commit 67957ea
Copy full SHA for 67957ea

File tree

Expand file treeCollapse file tree

2 files changed

+12
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-2
lines changed

‎Doc/library/constants.rst

Copy file name to clipboardExpand all lines: Doc/library/constants.rst
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ A small number of constants live in the built-in namespace. They are:
8282
:exc:`SyntaxError`), so they can be considered "true" constants.
8383

8484

85+
.. _site-consts:
86+
8587
Constants added by the :mod:`site` module
8688
-----------------------------------------
8789

@@ -97,6 +99,13 @@ should not be used in programs.
9799
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
98100
specified exit code.
99101

102+
.. data:: help
103+
:noindex:
104+
105+
Object that when printed, prints the message "Type help() for interactive
106+
help, or help(object) for help about object.", and when called,
107+
acts as described :func:`elsewhere <help>`.
108+
100109
.. data:: copyright
101110
credits
102111

‎Doc/library/site.rst

Copy file name to clipboardExpand all lines: Doc/library/site.rst
+3-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.