Raymond Hettinger <[email protected]> added the comment:
Rather than request a specific solution, I'll state what new problems need to
be solved.
For teaching purposes in live demos, it is essential to have a clear visual
distinction between the inputs and outputs:
>>> beatles = ['john', 'paul', 'ringo', 'george']
>>> [name.capitalize() for name in beatles]
['John', 'Paul', 'Ringo', 'George']
>>> [name for name in beatles if 'n' in name]
['john', 'ringo']
This doesn't work nearly as well:
beatles = ['john', 'paul', 'ringo', 'george']
[name.capitalize() for name in beatles]
['John', 'Paul', 'Ringo', 'George']
[name for name in beatles if 'n' in name]
['john', 'ringo']
With the sidebar, the ps1 prompt helps a little, but gray separator bar
visually runs the input and output text together and even causes consecutive
inputs to visually be merged. The strongest separator, the unindent, has been
lost.
>>>|beatles = ['john', 'paul', 'ringo', 'george']
|[name.capitalize() for name in beatles]
>>>|['John', 'Paul', 'Ringo', 'George']
|[name for name in beatles if 'n' in name]
>>>|['john', 'ringo']
I believe that if you consult a trained graphic designer (i.e. one who can name
the 7 elements of graphic design and describe how they are used), they will
confirm that the new display is problematic. To make data groups (inputs and
outputs) visually distinct, we can change alignment, change vertical spacing,
remove strong vertical lines, change color, etc.). But if you align the text
and run a vertical line separating it from the PS1 prompt, then the distinction
is blurred. At least this is what I was taught in graphic design courses.
Almost the entire purpose of graphic design in an IDE is to help the eye either
group together like pieces of information or to help the eye create
distinctions between dissimilar things. We give elements the same color if
they are related and different colors if unrelated. We bring like information
together by placing it close together or by giving it the same alignment. We
push things apart and disconnect them by drawing a separator line (in the case
at hand, the ps1 prompts are clipped-off in a separate window from the text
they were intended to annotate).
If we have to keep the sidebar, some vertical separation would help (as it does
in ipython):
>>>|beatles = ['john', 'paul', 'ringo', 'george']
|[name.capitalize() for name in beatles]
|
>>>|['John', 'Paul', 'Ringo', 'George']
|[name for name in beatles if 'n' in name]
|
>>>|['john', 'ringo']
|
This added spacing would help separate consecutive statements but would cost
eating up valuable vertical space and would not help with visually
distinguishing the input from the output.
You could take out the vertical line and get an improvement:
>>> beatles = ['john', 'paul', 'ringo', 'george']
[name.capitalize() for name in beatles]
>>> ['John', 'Paul', 'Ringo', 'George']
[name for name in beatles if 'n' in name]
>>> ['john', 'ringo']
This is better, but could be improved by unindenting to distinguish the inputs
and outputs, which just about takes us back to where we started from (not just
in IDLE, but what you see in books, presentations, and blog posts):
>>> beatles = ['john', 'paul', 'ringo', 'george']
>>> [name.capitalize() for name in beatles]
['John', 'Paul', 'Ringo', 'George']
>>> [name for name in beatles if 'n' in name]
['john', 'ringo']
Another desirable feature is the ability to cut and paste snippets into
docstrings. This is essential not just for doctest, but even for untested
examples in docstrings.
Those examples, need to be recognizable to humans as interactive sessions with
outputs clearly distinguished from inputs. When I tried out the new sidebar in
prep for a class, it was impossible to include the ps1 prompts in a cut and
paste selection. They had to be manually typed back in.
Lastly, for live demos in presentations, it is desirable to have a clear
screen, free of distracting artifacts. The sidebar is such an artifact -- you
would never see such a thing in a book or slide presentation. Also, for live
demos, large fonts are necessary which means that screen space is at a premium
and the loss of horizontal space matters.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37903>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com