Quantcast

Fwd: [Python-ideas] A better interactive prompt

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: [Python-ideas] A better interactive prompt

Nathan Goldbaum
This was just brought up on python-ideas. Perhaps one of the IPython maintainers wants to weigh in?

I'd love it if Python could automagically delegate to IPython for interactive sessions if IPython is available.

---------- Forwarded message ----------
From: Paul Moore <[hidden email]>
Date: Tue, Oct 25, 2016 at 4:13 PM
Subject: [Python-ideas] A better interactive prompt
To: "[hidden email]" <[hidden email]>


I've seen a lot of syntax proposals recently that are based around
providing better ways of writing "one liner" styles of code.
Typically, the proposals seem to get into trouble because:

1. They duplicate things that can already be done, just not in a
single expression/statement.
2. They are seen as over-terse, which is not generally seen as a good
thing in Python.

However, looking at them from the point of view of someone working at
the interactive prompt, they can seem much more attractive. The
natural unit of interaction at the command line is the single line. To
the extent that (for example) fixing a mistake in a multi-line
construct at the command line is a real pain.

But these limitations are not inherent to Python - they are problems
with the interactive prompt, which is fairly basic[1]. So maybe it's
worth looking at the root issue, how to make the interactive prompt
easier to use[2]?

But that's something of a solved problem. IPython offers a rich
interactive environment, for people who find the limitations of the
standard interactive prompt frustrating. Would it be worth the
standard Python documentation promoting IPython for that role? Maybe
even, if IPython is available, allowing the user to configure Python
to use it by default as the interactive prompt (a bit like readline,
but I dislike the way you can't switch off readline integration if
it's installed)? Ideally, if IPython was more readily available, fewer
users would be frustrated with Python's existing multi-line
constructs. And those that were, would have the option of looking into
custom IPython magic commands, before being forced to request language
changes.

Thoughts?

Paul

[1] On the other hand, the interactive prompt is a huge part of what
makes Python so great - these days, when I have to code in languages
that don't have an interactive prompt, it drives me nuts. And even
those that do, typically don't have one as good as Python's (in spite
of the fact that this whole mail is about needing to improve the
Python REPL).

[2] My apologies to anyone whose proposal was *not* based around
interactive use cases. I'm assuming motives here left, right and
centre, so if what I'm saying isn't what you were intending, that's
fine. Treat this as an unrelated proposal.
_______________________________________________
Python-ideas mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-dev
Loading...