summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2019-05-23 15:45:22 (GMT)
committerGitHub <noreply@github.com>2019-05-23 15:45:22 (GMT)
commitb82e17e626f7b1cd98aada0b1ebb65cb9f8fb184 (patch)
tree5370a2a075707cb0b37ce135cad6ffe23da424c4 /Doc/library/functions.rst
parente788057a9188ff37e232729815dfda2529079420 (diff)
downloadcpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.zip
cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.gz
cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.bz2
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 1a9a8b5..7170a78 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -275,6 +275,12 @@ are always available. They are listed here in alphabetical order.
If you want to parse Python code into its AST representation, see
:func:`ast.parse`.
+ .. audit-event:: compile "source filename"
+
+ Raises an :func:`auditing event <sys.audit>` ``compile`` with arguments
+ ``source`` and ``filename``. This event may also be raised by implicit
+ compilation.
+
.. note::
When compiling a string with multi-line code in ``'single'`` or
@@ -473,6 +479,11 @@ are always available. They are listed here in alphabetical order.
See :func:`ast.literal_eval` for a function that can safely evaluate strings
with expressions containing only literals.
+ .. audit-event:: exec code_object
+
+ Raises an :func:`auditing event <sys.audit>` ``exec`` with the code object as
+ the argument. Code compilation events may also be raised.
+
.. index:: builtin: exec
.. function:: exec(object[, globals[, locals]])
@@ -502,6 +513,11 @@ are always available. They are listed here in alphabetical order.
builtins are available to the executed code by inserting your own
``__builtins__`` dictionary into *globals* before passing it to :func:`exec`.
+ .. audit-event:: exec code_object
+
+ Raises an :func:`auditing event <sys.audit>` ``exec`` with the code object as
+ the argument. Code compilation events may also be raised.
+
.. note::
The built-in functions :func:`globals` and :func:`locals` return the current
@@ -747,6 +763,16 @@ are always available. They are listed here in alphabetical order.
If the :mod:`readline` module was loaded, then :func:`input` will use it
to provide elaborate line editing and history features.
+ .. audit-event:: builtins.input prompt
+
+ Raises an :func:`auditing event <sys.audit>` ``builtins.input`` with
+ argument ``prompt`` before reading input
+
+ .. audit-event:: builtins.input/result result
+
+ Raises an auditing event ``builtins.input/result`` with the result after
+ successfully reading input.
+
.. class:: int([x])
int(x, base=10)
@@ -1176,6 +1202,11 @@ are always available. They are listed here in alphabetical order.
(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`,
and :mod:`shutil`.
+ .. audit-event:: open "file mode flags"
+
+ The ``mode`` and ``flags`` arguments may have been modified or inferred from
+ the original call.
+
.. versionchanged::
3.3