Serhiy Storchaka added the comment:

> “Else” doesn’t always use a colon. Consider “1 if x else 2”.

Good catch Martin. Unfortunately the completer doesn't take context into 
account. "else" with a colon is a common case, but unwanted colon could be 
annoyed. I agree that it would be safe to not append a colon after "else". At 
least unless we make the completer context aware. However I don't think that 
unwanted space would be so annoyed. Here is updated patch.

I see that your code does an autocompletion for module names in "import", 
Martin. This was my next idea. Do you want to provide a patch for including 
this in CPython?

> I tested the patch. "wi<tab>" displays "with " (space)., but "fo<tab>" 
> displays "for" (no space). I don't understand why.

Because there is "format(".

> IMHO you should apply it to Python 3.4-3.6 (not only 3.6).

This is definitely a new feature. And there is a risk to break something (if 
standard completer is used programmatic).

----------
Added file: http://bugs.python.org/file40561/rlcompleter_keyword_space_3.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25209>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to