[Python-ideas] Open parenthesis in REPL completion

Rhodri James rhodri at kynesim.co.uk
Thu Apr 25 08:09:49 EDT 2019


On 25/04/2019 12:27, Stephen J. Turnbull wrote:
> Steven D'Aprano writes:
> 
>   > But having the opening bracket auto-added is a small satisfaction,
> 
> I'm not going to weigh in on this feature: I can see it either way.
> What I don't get is why we don't go full metal Emacs, by adding the
> corresponding end delimiter, and backspace.  In each line below the
> RHS are the characters typed, the LHS the characters inserted, and the
> vertical bar | represents the position of the insertion cursor:
> 
> (   => (|)
> [   => [|]
> {   => {|}
> "   => "|"
> ""  => ""|        # fooled ya, didn't I?  Could do it for parens too.
> """ => """|"""
> ''  => ''|
> ''' => '''|'''
> 
> There may be others.  And bonus points for DTRT in strings and
> comments (especially for "'", since it's used as apostrophe in
> non-program text).
> 
> Once I got used to it, I found it really cut down on the annoyance of
> counting parens and making sure start parens weren't paired with end
> braces and similar errors.  YMMV, of course.

My mileage definitely varies.  This sort of autocompletion is the first 
thing I turn off in the Eclipse-variants that come bundled with a lot of 
the SDKs I use, and I've never enabled it in EMACs.  Automatically 
highlighting where the matching brackets or quotes are is a lovely 
thing, but I like making my own decisions and stepping past or deleting 
decisions the editor has made for me is a pain.


-- 
Rhodri James *-* Kynesim Ltd


More information about the Python-ideas mailing list