summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-20 13:08:37 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-20 13:08:37 (GMT)
commit92058d29334fcb4d01ae2ab7c165aba2ef6da2af (patch)
tree582241ab556f1c425b52e646568d559e93c66e6a /Doc
parent440f2fff14f549f1deb8c9d1a9f52444acb1aad1 (diff)
downloadcpython-92058d29334fcb4d01ae2ab7c165aba2ef6da2af.zip
cpython-92058d29334fcb4d01ae2ab7c165aba2ef6da2af.tar.gz
cpython-92058d29334fcb4d01ae2ab7c165aba2ef6da2af.tar.bz2
#652749: document the constants added to the builtins by site.py.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/constants.rst27
-rw-r--r--Doc/library/functions.rst2
2 files changed, 27 insertions, 2 deletions
diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst
index 7e63978..222bc40 100644
--- a/Doc/library/constants.rst
+++ b/Doc/library/constants.rst
@@ -1,4 +1,3 @@
-
Built-in Constants
==================
@@ -47,4 +46,28 @@ A small number of constants live in the built-in namespace. They are:
This constant is true if Python was not started with an :option:`-O` option.
Assignments to :const:`__debug__` are illegal and raise a :exc:`SyntaxError`.
- See also the :keyword:`assert` statement. \ No newline at end of file
+ See also the :keyword:`assert` statement.
+
+
+Constants added by the :mod:`site` module
+-----------------------------------------
+
+The :mod:`site` module (which is imported automatically during startup, except
+if the :option:`-S` command-line option is given) adds several constants to the
+built-in namespace. They are useful for the interactive interpreter shell and
+should not be used in programs.
+
+.. data:: quit([code=None])
+ exit([code=None])
+
+ Objects that when printed, print a message like "Use quit() or Ctrl-D
+ (i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
+ specified exit code, and when .
+
+.. data:: copyright
+ license
+ credits
+
+ Objects that when printed, print a message like "Type license() to see the
+ full license text", and when called, display the corresponding text in a
+ pager-like fashion (one screen at a time).
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 665b865..227b0fc 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -511,6 +511,8 @@ available. They are listed here in alphabetical order.
topic, and a help page is printed on the console. If the argument is any other
kind of object, a help page on the object is generated.
+ This function is added to the built-in namespace by the :mod:`site` module.
+
.. versionadded:: 2.2