[Python-ideas] Have REPL print less by default

Franklin? Lee leewangzhong+python at gmail.com
Mon Apr 18 11:41:14 EDT 2016


On Apr 18, 2016 3:25 AM, "Nick Coghlan" <ncoghlan at gmail.com> wrote:
>
> On 18 April 2016 at 15:32, Franklin? Lee <leewangzhong+python at gmail.com>
wrote:
>>
>> On Apr 17, 2016 11:24 PM, "Ben Finney" <ben+python at benfinney.id.au>
wrote:
>> >
>> > Surem, that would be a good place for it. I think that's much more
>> > feasible than changing the behaviour of ‘repr’ for this purpose.
>>
>> Huh? I never meant for any change to happen to `repr`. The desired
behavior is, "Set default: Each command entered into the REPL should have
limited output (without loss of capability for a newbie)." The proposal is
to have the REPL determine when it's going to output too much.
>
> A few tips for folks that want to play with this:
>
> - setting sys.displayhook controls how evaluated objects are displayed in
the default REPL
> - setting sys.excepthook does the same for exceptions
> - the PYTHONSTARTUP env var runs the given file when the default REPL
starts
>
> So folks are already free to change their REPL to work however they want
it to: set sys.displayhook and sys.excepthook from a PYTHONSTARTUP file

I don't want arguments like, "This can already be done, for yourself, if
you really need it." I use IPython's shell, with maximum output height, and
it was years ago that I used a terminal which I couldn't scroll.

I want arguments like, "This will break my workflow."

> - improved defaults for teaching novices? Perhaps the default REPL isn't
the best environment for that

Why not? I imagine that self-taught novices will use the default REPL more
than the advanced users.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160418/212d464e/attachment.html>


More information about the Python-ideas mailing list