<div dir="ltr"><div>This was just brought up on python-ideas. Perhaps one of the IPython maintainers wants to weigh in?</div><div><br></div><div>I'd love it if Python could automagically delegate to IPython for interactive sessions if IPython is available.</div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Paul Moore</b> <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>></span><br>Date: Tue, Oct 25, 2016 at 4:13 PM<br>Subject: [Python-ideas] A better interactive prompt<br>To: "<a href="mailto:python-ideas@python.org">python-ideas@python.org</a>" <<a href="mailto:python-ideas@python.org">python-ideas@python.org</a>><br><br><br>I've seen a lot of syntax proposals recently that are based around<br>
providing better ways of writing "one liner" styles of code.<br>
Typically, the proposals seem to get into trouble because:<br>
<br>
1. They duplicate things that can already be done, just not in a<br>
single expression/statement.<br>
2. They are seen as over-terse, which is not generally seen as a good<br>
thing in Python.<br>
<br>
However, looking at them from the point of view of someone working at<br>
the interactive prompt, they can seem much more attractive. The<br>
natural unit of interaction at the command line is the single line. To<br>
the extent that (for example) fixing a mistake in a multi-line<br>
construct at the command line is a real pain.<br>
<br>
But these limitations are not inherent to Python - they are problems<br>
with the interactive prompt, which is fairly basic[1]. So maybe it's<br>
worth looking at the root issue, how to make the interactive prompt<br>
easier to use[2]?<br>
<br>
But that's something of a solved problem. IPython offers a rich<br>
interactive environment, for people who find the limitations of the<br>
standard interactive prompt frustrating. Would it be worth the<br>
standard Python documentation promoting IPython for that role? Maybe<br>
even, if IPython is available, allowing the user to configure Python<br>
to use it by default as the interactive prompt (a bit like readline,<br>
but I dislike the way you can't switch off readline integration if<br>
it's installed)? Ideally, if IPython was more readily available, fewer<br>
users would be frustrated with Python's existing multi-line<br>
constructs. And those that were, would have the option of looking into<br>
custom IPython magic commands, before being forced to request language<br>
changes.<br>
<br>
Thoughts?<br>
<br>
Paul<br>
<br>
[1] On the other hand, the interactive prompt is a huge part of what<br>
makes Python so great - these days, when I have to code in languages<br>
that don't have an interactive prompt, it drives me nuts. And even<br>
those that do, typically don't have one as good as Python's (in spite<br>
of the fact that this whole mail is about needing to improve the<br>
Python REPL).<br>
<br>
[2] My apologies to anyone whose proposal was *not* based around<br>
interactive use cases. I'm assuming motives here left, right and<br>
centre, so if what I'm saying isn't what you were intending, that's<br>
fine. Treat this as an unrelated proposal.<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div><br></div>