Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(29)

Side by Side Diff: Doc/library/code.rst

Issue 18758: Fix internal references in the documentation
Patch Set: Created 6 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/codecs.rst ('k') | Doc/library/collections.abc.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`code` --- Interpreter base classes 1 :mod:`code` --- Interpreter base classes
2 ======================================== 2 ========================================
3 3
4 .. module:: code 4 .. module:: code
5 :synopsis: Facilities to implement read-eval-print loops. 5 :synopsis: Facilities to implement read-eval-print loops.
6 6
7 7
8 The ``code`` module provides facilities to implement read-eval-print loops in 8 The ``code`` module provides facilities to implement read-eval-print loops in
9 Python. Two classes and convenience functions are included which can be used to 9 Python. Two classes and convenience functions are included which can be used to
10 build applications which provide an interactive interpreter prompt. 10 build applications which provide an interactive interpreter prompt.
(...skipping 13 matching lines...) Expand all
24 24
25 Closely emulate the behavior of the interactive Python interpreter. This clas s 25 Closely emulate the behavior of the interactive Python interpreter. This clas s
26 builds on :class:`InteractiveInterpreter` and adds prompting using the famili ar 26 builds on :class:`InteractiveInterpreter` and adds prompting using the famili ar
27 ``sys.ps1`` and ``sys.ps2``, and input buffering. 27 ``sys.ps1`` and ``sys.ps2``, and input buffering.
28 28
29 29
30 .. function:: interact(banner=None, readfunc=None, local=None) 30 .. function:: interact(banner=None, readfunc=None, local=None)
31 31
32 Convenience function to run a read-eval-print loop. This creates a new insta nce 32 Convenience function to run a read-eval-print loop. This creates a new insta nce
33 of :class:`InteractiveConsole` and sets *readfunc* to be used as the 33 of :class:`InteractiveConsole` and sets *readfunc* to be used as the
34 :meth:`raw_input` method, if provided. If *local* is provided, it is passed to 34 :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is prov ided, it is passed to
35 the :class:`InteractiveConsole` constructor for use as the default namespace for 35 the :class:`InteractiveConsole` constructor for use as the default namespace for
36 the interpreter loop. The :meth:`interact` method of the instance is then ru n 36 the interpreter loop. The :meth:`interact` method of the instance is then ru n
37 with *banner* passed as the banner to use, if provided. The console object i s 37 with *banner* passed as the banner to use, if provided. The console object i s
38 discarded after use. 38 discarded after use.
39 39
40 40
41 .. function:: compile_command(source, filename="<input>", symbol="single") 41 .. function:: compile_command(source, filename="<input>", symbol="single")
42 42
43 This function is useful for programs that want to emulate Python's interprete r 43 This function is useful for programs that want to emulate Python's interprete r
44 main loop (a.k.a. the read-eval-print loop). The tricky part is to determine 44 main loop (a.k.a. the read-eval-print loop). The tricky part is to determine
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 Remove any unhandled source text from the input buffer. 156 Remove any unhandled source text from the input buffer.
157 157
158 158
159 .. method:: InteractiveConsole.raw_input(prompt="") 159 .. method:: InteractiveConsole.raw_input(prompt="")
160 160
161 Write a prompt and read a line. The returned line does not include the trail ing 161 Write a prompt and read a line. The returned line does not include the trail ing
162 newline. When the user enters the EOF key sequence, :exc:`EOFError` is raise d. 162 newline. When the user enters the EOF key sequence, :exc:`EOFError` is raise d.
163 The base implementation reads from ``sys.stdin``; a subclass may replace this 163 The base implementation reads from ``sys.stdin``; a subclass may replace this
164 with a different implementation. 164 with a different implementation.
165 165
OLDNEW
« no previous file with comments | « Doc/library/codecs.rst ('k') | Doc/library/collections.abc.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+