summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-05-15 01:38:17 (GMT)
committerGitHub <noreply@github.com>2020-05-15 01:38:17 (GMT)
commiteb5ce324f724a59c51d7a76d1dd49b550cdf386b (patch)
treef7c233837191806670c00fbe8d9e7984be56f89e /Doc/library
parent35b8a4da7494cd51f3edeaa07764dd8f14bac0bf (diff)
downloadcpython-eb5ce324f724a59c51d7a76d1dd49b550cdf386b.zip
cpython-eb5ce324f724a59c51d7a76d1dd49b550cdf386b.tar.gz
cpython-eb5ce324f724a59c51d7a76d1dd49b550cdf386b.tar.bz2
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047) (GH-20098)
* Document exec symbol for codeop.compile_command * Remove extra statements Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com> (cherry picked from commit 7ba1f75f3f02b4b50ac6d7e17d15e467afa36aac) Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/code.rst4
-rw-r--r--Doc/library/codeop.rst5
2 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/code.rst b/Doc/library/code.rst
index 6708079..538e5af 100644
--- a/Doc/library/code.rst
+++ b/Doc/library/code.rst
@@ -56,8 +56,8 @@ build applications which provide an interactive interpreter prompt.
*source* is the source string; *filename* is the optional filename from which
source was read, defaulting to ``'<input>'``; and *symbol* is the optional
- grammar start symbol, which should be either ``'single'`` (the default) or
- ``'eval'``.
+ grammar start symbol, which should be ``'single'`` (the default), ``'eval'``
+ or ``'exec'``.
Returns a code object (the same as ``compile(source, filename, symbol)``) if the
command is complete and valid; ``None`` if the command is incomplete; raises
diff --git a/Doc/library/codeop.rst b/Doc/library/codeop.rst
index a52d2c6..c66b9d3 100644
--- a/Doc/library/codeop.rst
+++ b/Doc/library/codeop.rst
@@ -43,8 +43,9 @@ To do just the former:
:exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal.
The *symbol* argument determines whether *source* is compiled as a statement
- (``'single'``, the default) or as an :term:`expression` (``'eval'``). Any
- other value will cause :exc:`ValueError` to be raised.
+ (``'single'``, the default), as a sequence of statements (``'exec'``) or
+ as an :term:`expression` (``'eval'``). Any other value will
+ cause :exc:`ValueError` to be raised.
.. note::