Skip to content

Commit d58ff6a

Browse files
Minor docs improvements fix for codeop (GH-103123)
(cherry picked from commit c1e71ce) Co-authored-by: gaogaotiantian <[email protected]>
1 parent ba755a2 commit d58ff6a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/codeop.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ module instead.
1919

2020
There are two parts to this job:
2121

22-
#. Being able to tell if a line of input completes a Python statement: in
22+
#. Being able to tell if a line of input completes a Python statement: in
2323
short, telling whether to print '``>>>``' or '``...``' next.
2424

25-
#. Remembering which future statements the user has entered, so subsequent
25+
#. Remembering which future statements the user has entered, so subsequent
2626
input can be compiled with these in effect.
2727

2828
The :mod:`codeop` module provides a way of doing each of these things, and a way
@@ -33,19 +33,19 @@ To do just the former:
3333
.. function:: compile_command(source, filename="<input>", symbol="single")
3434

3535
Tries to compile *source*, which should be a string of Python code and return a
36-
code object if *source* is valid Python code. In that case, the filename
36+
code object if *source* is valid Python code. In that case, the filename
3737
attribute of the code object will be *filename*, which defaults to
38-
``'<input>'``. Returns ``None`` if *source* is *not* valid Python code, but is a
38+
``'<input>'``. Returns ``None`` if *source* is *not* valid Python code, but is a
3939
prefix of valid Python code.
4040

4141
If there is a problem with *source*, an exception will be raised.
4242
:exc:`SyntaxError` is raised if there is invalid Python syntax, and
4343
:exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal.
4444

4545
The *symbol* argument determines whether *source* is compiled as a statement
46-
(``'single'``, the default), as a sequence of statements (``'exec'``) or
46+
(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) or
4747
as an :term:`expression` (``'eval'``). Any other value will
48-
cause :exc:`ValueError` to be raised.
48+
cause :exc:`ValueError` to be raised.
4949

5050
.. note::
5151

@@ -69,5 +69,5 @@ To do just the former:
6969

7070
Instances of this class have :meth:`__call__` methods identical in signature to
7171
:func:`compile_command`; the difference is that if the instance compiles program
72-
text containing a ``__future__`` statement, the instance 'remembers' and
72+
text containing a :mod:`__future__` statement, the instance 'remembers' and
7373
compiles all subsequent program texts with the statement in force.

0 commit comments

Comments
 (0)