[issue25209] Append space after completed keywords

2015-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Martin. Hope to see your patch for completing import statement. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tr

[issue25209] Append space after completed keywords

2015-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset f64ec4aac935 by Serhiy Storchaka in branch 'default': Issue #25209: rlcomplete now can add a space or a colon after completed keyword. https://hg.python.org/cpython/rev/f64ec4aac935 -- nosy: +python-dev _

[issue25209] Append space after completed keywords

2015-09-25 Thread Martin Panter
Martin Panter added the comment: Yes I am interesting in making a patch for auto-completing module names. I’ll leave it on my to-do list, but don’t expect it overnight. :) My code does some rough parsing of Python syntax, but maybe that is not needed for “import x”, though it might be needed t

[issue25209] Append space after completed keywords

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: > This is definitely a new feature. And there is a risk to break something (if > standard completer is used programmatic). Ok, it's up to you. -- ___ Python tracker _

[issue25209] Append space after completed keywords

2015-09-24 Thread Serhiy Storchaka
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 a

[issue25209] Append space after completed keywords

2015-09-24 Thread Martin Panter
Martin Panter added the comment: Victor, maybe because “for” also stands for “format”? -- ___ Python tracker ___ ___ Python-bugs-list

[issue25209] Append space after completed keywords

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: I tested the patch. "wi" displays "with " (space)., but "fo" displays "for" (no space). I don't understand why. Well, it's not a big issue, anyway the patch looks good to me. IMHO you should apply it to Python 3.4-3.6 (not only 3.6). -- nosy: +haypo

[issue25209] Append space after completed keywords

2015-09-22 Thread Martin Panter
Martin Panter added the comment: “Else” doesn’t always use a colon. Consider “1 if x else 2”. Again, if Python started adding unwanted spaces and colons I imagine users could be annoyed and think Python is being too smart and complicated for its own good. But maybe see what others say. --

[issue25209] Append space after completed keywords

2015-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch Martin. Indeed, "pass", "break" and "continue" don't need a space, and "True", "False" and "None" need a space only in rare cases like "None in collection". Some keywords ("else", "finally", "try") need a colon. But while "return" and "lambda" not

[issue25209] Append space after completed keywords

2015-09-21 Thread Martin Panter
Martin Panter added the comment: I agree with adding a space in some cases, but not others. E.g. "pass" would only need a space if you wanted to add a comment, "return" often takes no argument, "lambda" may need an immediate colon (lambda: x). See

[issue25209] Append space after completed keywords

2015-09-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Open parenthesis ('(') is appended after completed callable globals and attributes. I propose to add a space after completed keyword. In most cases a space is either required after the keyword, or recommended by PEP8. Attached patch implements this. -