summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-02-24 01:47:06 (GMT)
committerGitHub <noreply@github.com>2021-02-24 01:47:06 (GMT)
commitbdf0fece5bbc2fc9fffbf0f314c7022e24e747df (patch)
tree12006f491ad9bea9e2590fbab4bb3ee17a197311 /Doc/library
parent9dd018e35cce30bc2545290b6083dbf6e50d7b61 (diff)
downloadcpython-bdf0fece5bbc2fc9fffbf0f314c7022e24e747df.zip
cpython-bdf0fece5bbc2fc9fffbf0f314c7022e24e747df.tar.gz
cpython-bdf0fece5bbc2fc9fffbf0f314c7022e24e747df.tar.bz2
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615) (GH-24632)
Printing to IDLE's Shell is often slower than printing to a system terminal, but it can be made faster by pre-formatting a single string before printing. (cherry picked from commit 2827e8a177c2a6584fada594bca6829c53a2872f) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/idle.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index fc45e31..2b9bd4b 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -726,6 +726,15 @@ with objects that get input from and send output to the Shell window.
The original values stored in ``sys.__stdin__``, ``sys.__stdout__``, and
``sys.__stderr__`` are not touched, but may be ``None``.
+Sending print output from one process to a text widget in another is
+slower than printing to a system terminal in the same process.
+This has the most effect when printing multiple arguments, as the string
+for each argument, each separator, the newline are sent separately.
+For development, this is usually not a problem, but if one wants to
+print faster in IDLE, format and join together everything one wants
+displayed together and then print a single string. Both format strings
+and :meth:`str.join` can help combine fields and lines.
+
IDLE's standard stream replacements are not inherited by subprocesses
created in the execution process, whether directly by user code or by
modules such as multiprocessing. If such subprocess use ``input`` from