[Python-ideas] Have REPL print less by default

Chris Angelico rosuav at gmail.com
Tue Apr 19 06:37:08 EDT 2016

On Tue, Apr 19, 2016 at 8:10 PM, Franklin? Lee
<leewangzhong+python at gmail.com> wrote:
> This is a concern, but not one that is enough, by itself, to justify the
> status quo. I disagree that it applies *anywhere near as much* here, since I
> don't see how it could break existing code. It will add a little adjustment
> and a little more work sometimes, but it doesn't require, say, refactoring a
> module, or every site page you ever downloaded.

You have things slightly backwards. The status quo doesn't have to
justify itself; a change does. Particularly when there's ANY backward
incompatibility being brought in, the change has to be of material
benefit, or it isn't going to happen. Take, for example, this bug


Notice that:

* The error is clearly *incorrect*. The interpreter should not be
raising SystemError in valid situations.
* The old behaviour (raising ValueError) is also incorrect, but Brett
offered it as a serious possibility.
* Only the latest CPython was changed (the 'default' branch). It
wasn't correspondingly fixed in 3.4 or 3.5.
* Nobody ever even *considered* changing 2.7's behaviour.

Backward compatibility CAN be broken, but it's a big deal. Anything
that can be done simply by changing a few local options is preferable
to a core language change. Remember, anyone can redistribute Python
with a modified site.py or other init script, or create a shortcut
icon or shell script that invokes "python3 -i local_customizations.py"
rather than simply running "python3" - and that script can do whatever
you want it to, including changing sys.displayhook and sys.excepthook.


More information about the Python-ideas mailing list