[Python-ideas] Open parenthesis in REPL completion

Steven D'Aprano steve at pearwood.info
Thu Apr 25 04:33:19 EDT 2019

On Fri, Apr 19, 2019 at 05:12:06PM -0300, Danilo J. S. Bellini wrote:

> I'm not aware if that was already discussed, but something I find quite
> annoying is the REPL auto-complete that also includes the open parenthesis
> symbol. I think it shouldn't be included in TAB completion. At least twice
> a week I make mistakes like typing "help(something()" with unmatched
> parentheses

You could try reading the command line before hitting Enter *wink*

I know what you mean, and it's a tiny annoyance for me too that when I 
type "help(function(" I have to delete the autocompleted opening 
bracket. So I guess that's a small annoyance a few dozen times a day.

But having the opening bracket auto-added is a small satisfaction, and 
if you're using the REPL for actual calculations and not just help(), 
the benefit probably outweighs the annoyance:

    # save up to four opening brackets
    result = function(myclass(arg)) + another(x).method()

So I don't think that have the extra complication of a switch to turn 
this feature off is a good idea.


More information about the Python-ideas mailing list