Author terry.reedy
Recipients Marco Sulla, eryksun, steven.daprano, terry.reedy
Date 2020-03-04.04:34:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Not surprisingly, I agree with Steven that enhancing IDLE may be a better use of core developer time.  It and Tkinter (and turtle) are options for the Windows and macOS (and some non-PSF) installers and easily installed  on Linux.  IDLE has most of the requested features, and where it does not, I will consider well-specified enhancements.  

1. Pasting a compound statement with embedded blank lines.

>>> def f():
	a = 1  # following line has no spaces or tabs

	print(a, b)

>>> f()
1, 3

Pasting multiple statements, separated or not by blank lines, and pasting non-BMP unicode, are separate issues.

2. Auto-indent: after ':' (see example above) and for syntactic sequences.  (Currently, the latter only works in editors because '>>> ' prompts and tab indents interfere.  There is a issue with PR that will allow this to be fixed.)

strings = ['a',
           'b',  # autoindent
ardvark = fribble(a,
                  b,  # autoindent

3. Code blocks are one history entry.  Yes, where 'code block' means one complete statement, possibly multiple lines, as submitted for execution.  The example in 1. can be recalled as submitted, with the blank line.

4. Save interactive session.  Yes.  I intend to add an option to only save code, without prompts or output, so the code can be pasted into an editor and edited and run.  Or maybe the code should be loaded directly into an editor.

5. Add history() builtin.  I believe that on linux this is redundant with existing enhanced history mechanisms, which include storing history across sessions in a 'standard' place.  I believe my idea for 4. covers must of the use cases.

6. Add a. pprint and b. getsource to builtins.  I think this would be rejected.  I seldom use either of those two functions, but constantly import other things. So I would want other things added.  Startup files are the mechanism for personally customizing one's shell.  Simple imports serve for ad hoc customizations. Note that getsource(name) needs to be passed to print() to be readable.

As for getting source: IDLE displays a popup signature for any function if one is available.  Given a traceback or grep output, one can open any source-based module in an editor at the line indicated.  Open Module lets one easily open any importable source based module with only the import name, not the full path.  For long source chunks, a separate window is really much better than printed in the shell.  A possible IDLE enhancement would be the ability to add an object name and to jump to its definition.

7. Syntax coloring.  Yes, with full customization.

8. Bracket matching for(), {}, and []. Yes, with a couple of options.
Date User Action Args
2020-03-04 04:34:33terry.reedysetrecipients: + terry.reedy, steven.daprano, eryksun, Marco Sulla
2020-03-04 04:34:33terry.reedysetmessageid: <>
2020-03-04 04:34:33terry.reedylinkissue38747 messages
2020-03-04 04:34:32terry.reedycreate