[Python-ideas] Small nice addition to rlcompleter

Andrew Toulouse andrew at atoulou.se
Wed Jun 25 18:53:37 CEST 2008


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 at gmail.com>
wrote:

> 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.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20080625/6fa832fb/attachment.htm>


More information about the Python-ideas mailing list