Re: [Python-ideas] A better interactive prompt

2016-10-28 Thread Terry Reedy
On 10/25/2016 5:13 PM, Paul Moore wrote: 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. Try IDLE. The unit of interaction is the statement. One writes, edi

Re: [Python-ideas] A better interactive prompt

2016-10-27 Thread Steven D'Aprano
On Thu, Oct 27, 2016 at 10:35:32AM +0100, Paul Moore wrote: > The Windows default command line editing experience is a lot better > (IMO) than the (non-readline) Unix default, and it's common throughout > all interactive prompts (Python's REPL included). As a result, when > readline is installed (

Re: [Python-ideas] A better interactive prompt

2016-10-27 Thread Paul Moore
On 27 October 2016 at 01:49, Steven D'Aprano wrote: >> (a bit like readline, >> but I dislike the way you can't switch off readline integration if >> it's installed)? > > This comment surprises me. To me, that's like saying "I dislike the way > you can't switch off breathing" -- readline is almost

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread eryk sun
On Wed, Oct 26, 2016 at 10:16 PM, Cody Piersall wrote: > Isn't that check really just an isatty() check? Or is that not > reliable enough for some reason? It's not reliable in Windows. There are no tty devices, so the C runtime's implementation of isatty() instead returns true for character devi

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Steven D'Aprano
On Tue, Oct 25, 2016 at 10:13:54PM +0100, Paul Moore wrote: > I've seen a lot of syntax proposals recently that are based around > providing better ways of writing "one liner" styles of code. [...] > However, looking at them from the point of view of someone working at > the interactive prompt, the

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Steven D'Aprano
On Wed, Oct 26, 2016 at 02:40:36PM -0700, Nikolaus Rath wrote: > It also imposes a significant burden on scripting. "It" being a configurable REPL. > I often have elements like this in shell scripts: > > output=$(python < import h5py > with h5py.File('foo', 'r') as fh: > print((fh['bla']

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Tim Mitchell
Mark, Windows folk do not type pip install ipython On windows it's much easier: 1) install pycharm (because it has UI for installing packages) 2) Go to settings > project interpreter 3) select the python interpeter you want to use 4) click the + button 5) search through the entire pypi listing f

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Mark Lawrence via Python-ideas
On 26/10/2016 20:24, Paul Moore wrote: On 26 October 2016 at 18:25, Nick Coghlan wrote: The built-in REPL serves two quite divergent use cases, and I think we're well past the point where we can't readily support both use cases with a single implementation: - a minimalist interactive environme

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Nathaniel Smith
On Wed, Oct 26, 2016 at 3:16 PM, Cody Piersall wrote: > On Wed, Oct 26, 2016 at 4:48 PM, Paul Moore wrote: >> Good point. We could, of course, detect when stdin is non-interactive, >> but at that point the code is starting to get unreasonably complex, as >> well as having way too many special cas

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Cody Piersall
On Wed, Oct 26, 2016 at 4:48 PM, Paul Moore wrote: > Good point. We could, of course, detect when stdin is non-interactive, > but at that point the code is starting to get unreasonably complex, as > well as having way too many special cases. So I agree, that probably > kills the proposal. Isn't t

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Paul Moore
On 26 October 2016 at 22:40, Nikolaus Rath wrote: > It also imposes a significant burden on scripting. I often have elements > like this in shell scripts: > > output=$(python < import h5py > with h5py.File('foo', 'r') as fh: > print((fh['bla'] * fh['com']).sum()) > EOF > ) > > If this now sta

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Nikolaus Rath
On Oct 26 2016, Paul Moore wrote: > Thinking a little further about this, I think the reason I don't use > IPython more, is because my muscle memory types "python" (or more > often, "py") when I want an interactive prompt. And I do that for the > reason you mention - it's always there. > > The do

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Paul Moore
On 26 October 2016 at 22:11, Todd wrote: > Isn't this what aliases are for? Just set "python" to be an alias for > "ipython" for your interactive shell. I hadn't thought of that option. I might give it a try. Although I'm not sure how I'd set up a Powershell function (I'm on Windows) that would

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Todd
On Wed, Oct 26, 2016 at 3:24 PM, Paul Moore wrote: > On 26 October 2016 at 18:25, Nick Coghlan wrote: > > The built-in REPL serves two quite divergent use cases, and I think > > we're well past the point where we can't readily support both use > > cases with a single implementation: > > > > - a

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Paul Moore
On 26 October 2016 at 21:43, Nikolaus Rath wrote: >> So I think that it would be really useful to be able to plug in a new >> REPL, when it's available. This has a number of benefits: >> >> 1. We don't need to worry about incorporating any complex REPL code >> into Python. The default REPL can rem

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Nikolaus Rath
On Oct 26 2016, Paul Moore wrote: > On 26 October 2016 at 18:25, Nick Coghlan > wrote: >> The built-in REPL serves two quite divergent use cases, and I think >> we're well past the point where we can't readily support both use >> cases with a single implementation: >> >> - a minimalist interact

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Paul Moore
On 26 October 2016 at 18:25, Nick Coghlan wrote: > The built-in REPL serves two quite divergent use cases, and I think > we're well past the point where we can't readily support both use > cases with a single implementation: > > - a minimalist interactive environment, that is *always* present, eve

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Nick Coghlan
On 26 October 2016 at 09:15, Nathaniel Smith wrote: > Incidentally, PyPy's built-in REPL handles multi-line constructs like > IPython does, rather than like how the CPython built-in REPL does. > > There are a lot of logistic issues that would need to be dealt with > before CPython could consider m

Re: [Python-ideas] A better interactive prompt

2016-10-25 Thread Nathaniel Smith
On Tue, Oct 25, 2016 at 2:55 PM, Chris Barker wrote: > > >> 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 prom

Re: [Python-ideas] A better interactive prompt

2016-10-25 Thread Mike Miller
Would recommend bpython, it is lighter-weight and accessible to newbies, in the sense that a manual is not needed. It just starts helping out as you type. http://bpython-interpreter.org/ ___ Python-ideas mailing list Python-ideas@python.org https://m

Re: [Python-ideas] A better interactive prompt

2016-10-25 Thread Chris Barker
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? +1 iPython really makes it easier

[Python-ideas] A better interactive prompt

2016-10-25 Thread Paul Moore
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