[Python-ideas] Small nice addition to rlcompleter

J. Pablo Fernández pupeno at gmail.com
Wed Jun 25 11:16:28 CEST 2008


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 at gmail.com> wrote:
> Roman Susi wrote:
>
>> I think it could be cool if callable objects were added
>> "("
>> when completed.
>
>
> Facundo Batista wrote:
>
>> Leonardo Santagada:
>>
>> > 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.
>>
>> +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?
>
>
> 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.
>

-- 
Sent from Gmail for mobile | mobile.google.com

J. Pablo Fernández <pupeno at pupeno.com> (http://pupeno.com)
    Temporarily using pupeno at gmail.com.


More information about the Python-ideas mailing list