summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/help.html
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2021-02-24 00:39:51 (GMT)
committerGitHub <noreply@github.com>2021-02-24 00:39:51 (GMT)
commit2827e8a177c2a6584fada594bca6829c53a2872f (patch)
tree4110f13a66a62ce34205652c8df4fd8bb506bad2 /Lib/idlelib/help.html
parentb798ab06937f8bb24b444a49dd42e11fff15e654 (diff)
downloadcpython-2827e8a177c2a6584fada594bca6829c53a2872f.zip
cpython-2827e8a177c2a6584fada594bca6829c53a2872f.tar.gz
cpython-2827e8a177c2a6584fada594bca6829c53a2872f.tar.bz2
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615)
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.
Diffstat (limited to 'Lib/idlelib/help.html')
-rw-r--r--Lib/idlelib/help.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
index 1eefa50..924042d 100644
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -679,6 +679,14 @@ process, it replaces <code class="docutils literal notranslate"><span class="pre
with objects that get input from and send output to the Shell window.
The original values stored in <code class="docutils literal notranslate"><span class="pre">sys.__stdin__</span></code>, <code class="docutils literal notranslate"><span class="pre">sys.__stdout__</span></code>, and
<code class="docutils literal notranslate"><span class="pre">sys.__stderr__</span></code> are not touched, but may be <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
+<p>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 <a class="reference internal" href="stdtypes.html#str.join" title="str.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">str.join()</span></code></a> can help combine fields and lines.</p>
<p>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 <code class="docutils literal notranslate"><span class="pre">input</span></code> from
@@ -982,7 +990,7 @@ also used for testing.</p>
<br />
<br />
- Last updated on Feb 21, 2021.
+ Last updated on Feb 23, 2021.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br />