10000 bpo-43283: Add IDLE doc paragraph about print speed by terryjreedy · Pull Request #24615 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43283: Add IDLE doc paragraph about print speed #24615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-43283: Add IDLE doc paragraph about print speed
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.
  • Loading branch information
8000
terryjreedy committed Feb 21, 2021
commit eebd004d667b7f9513aa84f02ef19f7e5ce3ee95
9 changes: 9 additions & 0 deletions Doc/library/idle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 ``separator.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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Document why printing to IDLE's Shell is often slower than printing to a
system terminal and that it can be made faster by pre-formatting a single
string before printing.
0