
hi! I had that proposal (stated back in 2001 here http://bugs.python.org/issue449227 ), with these main moments to cite myself: <<< I use rlcompleter extensively in interactive Python mode. I think it could be cool if callable objects were added "(" when completed. This way it will be much faster to program, without looking-up __doc__. For example:
One more illustration:
- nice to remember which attributes are methods and which aren't.
There are patches recently made by Manuel Muradás and Facundo Batista for 2.6 (so I assume some people are interested in the patch, not only me), but I have no idea how (and if) it ever gets into Python? 2.6 and 3k. Its a very small feature to make a PEP, but how then? I hope rlcompleter will not get obsoleted before the patch is accepted ;-) Thanks! Regards, Roman

2008/6/24 Roman Susi <rnd@onego.ru>:
Manuel did all the work, not me, I'll just handling this because of the last Python Bug Day. If everything is ok, I should be working on this this week. Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

On 24/06/2008, at 14:41, Roman Susi wrote:
Why not make a pep about something bigger then? I think python needs a more complete interactive interpreter... something that would work right after installing python. I think the language strives to be easy and with a smooth learning curve, this could probably help. -- Leonardo Santagada

2008/6/24 Leonardo Santagada <santagada@gmail.com>:
+1. Note, though, that it's not as easy as it sounds. For example, note that the very useful and simple behaviour of doing up-arrow and bringing the last line, is not handled by Python code, but by the external library readline. My point is: you can propose a lot of things (I surely will love autocompletion and better block management), but how would you achieve that in a multiplatform way? Thanks! -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

Facundo Batista wrote:
pyreadline? Pure Python shell with capabilities of plugins and kind of WSGI but for shell functions, bringing Python shell to anywhere (Unix CLI, smartphone, IDE, webconsole, IRC, ...) with the same abstraction level? Over XML? Cool idea, isnt' it? (security alittle bit of concern though) It may redefine the whole idea of what is Programming language's interactive shell. Then if Python ShAPI will be established, readline can be reused in a form of plugin...
Regards, Roman

Roman Susi wrote:
Facundo Batista wrote:
IDLE? Which has auto-completion, BTW, and for which I wrote a patch two years ago which adds () after a completed callable, placing the cursor in between these parenthesis, and bringing up the callable's call-tip while it's at it (without obscuring the current line - yay GUI!). The patch was never posted to the Python issue tracker because I thought there was no interest, but it would be easy to do so. (more rambling ahead...) The annoying bit about my implementation was that I had to use the right arrow key in order to move past the closing parenthesis. This could be overcome by just adding the opening '(' as suggested above, or perhaps by making closing the parenthesis by typing ')' simply "overwrite" the existing ')' character (with good recognition of when you're just typing a ')' in a string or closing an inner pair of parenthesis, of course). While I was at it, I also made it complete dict keys (only complete-able keys like strings and numbers) and auto-magically add [] after completed dicts (with the cursor placed in between), which I found to be surprisingly useful in interactive work. - Tal P.S. Thanks to Shai Geva for suggesting that I implement the above mentioned features.

Something else you could add is that pressing backspace just after the completion, deleting the open paren will also automatically delete the closing paren. I would also add tab as a key to jump beyond the closing paren. On 6/25/08, Tal Einat <taleinat@gmail.com> wrote:
-- Sent from Gmail for mobile | mobile.google.com J. Pablo Fernández <pupeno@pupeno.com> (http://pupeno.com) Temporarily using pupeno@gmail.com.

Yeah, I think tab-to-complete as well as closeparen-to-complete are fairly standard, and I'd appreciate those. Incidentally, would this be a generalized framework so we could, say, implement a DSL and a shell within python, or would it specifically be a python shell? Obviously, Python itself already has a pretty interactive interpreter in the form of IPython... --Andy On Wed, Jun 25, 2008 at 2:16 AM, J. Pablo Fernández <pupeno@gmail.com> wrote:

2008/6/24 Roman Susi <rnd@onego.ru>:
Manuel did all the work, not me, I'll just handling this because of the last Python Bug Day. If everything is ok, I should be working on this this week. Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

On 24/06/2008, at 14:41, Roman Susi wrote:
Why not make a pep about something bigger then? I think python needs a more complete interactive interpreter... something that would work right after installing python. I think the language strives to be easy and with a smooth learning curve, this could probably help. -- Leonardo Santagada

2008/6/24 Leonardo Santagada <santagada@gmail.com>:
+1. Note, though, that it's not as easy as it sounds. For example, note that the very useful and simple behaviour of doing up-arrow and bringing the last line, is not handled by Python code, but by the external library readline. My point is: you can propose a lot of things (I surely will love autocompletion and better block management), but how would you achieve that in a multiplatform way? Thanks! -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

Facundo Batista wrote:
pyreadline? Pure Python shell with capabilities of plugins and kind of WSGI but for shell functions, bringing Python shell to anywhere (Unix CLI, smartphone, IDE, webconsole, IRC, ...) with the same abstraction level? Over XML? Cool idea, isnt' it? (security alittle bit of concern though) It may redefine the whole idea of what is Programming language's interactive shell. Then if Python ShAPI will be established, readline can be reused in a form of plugin...
Regards, Roman

Roman Susi wrote:
Facundo Batista wrote:
IDLE? Which has auto-completion, BTW, and for which I wrote a patch two years ago which adds () after a completed callable, placing the cursor in between these parenthesis, and bringing up the callable's call-tip while it's at it (without obscuring the current line - yay GUI!). The patch was never posted to the Python issue tracker because I thought there was no interest, but it would be easy to do so. (more rambling ahead...) The annoying bit about my implementation was that I had to use the right arrow key in order to move past the closing parenthesis. This could be overcome by just adding the opening '(' as suggested above, or perhaps by making closing the parenthesis by typing ')' simply "overwrite" the existing ')' character (with good recognition of when you're just typing a ')' in a string or closing an inner pair of parenthesis, of course). While I was at it, I also made it complete dict keys (only complete-able keys like strings and numbers) and auto-magically add [] after completed dicts (with the cursor placed in between), which I found to be surprisingly useful in interactive work. - Tal P.S. Thanks to Shai Geva for suggesting that I implement the above mentioned features.

Something else you could add is that pressing backspace just after the completion, deleting the open paren will also automatically delete the closing paren. I would also add tab as a key to jump beyond the closing paren. On 6/25/08, Tal Einat <taleinat@gmail.com> wrote:
-- Sent from Gmail for mobile | mobile.google.com J. Pablo Fernández <pupeno@pupeno.com> (http://pupeno.com) Temporarily using pupeno@gmail.com.

Yeah, I think tab-to-complete as well as closeparen-to-complete are fairly standard, and I'd appreciate those. Incidentally, would this be a generalized framework so we could, say, implement a DSL and a shell within python, or would it specifically be a python shell? Obviously, Python itself already has a pretty interactive interpreter in the form of IPython... --Andy On Wed, Jun 25, 2008 at 2:16 AM, J. Pablo Fernández <pupeno@gmail.com> wrote:
participants (6)
-
Andrew Toulouse
-
Facundo Batista
-
J. Pablo Fernández
-
Leonardo Santagada
-
Roman Susi
-
Tal Einat