[issue44325] IDLE: Fix shell comment anomalies

Tal Einat report at bugs.python.org
Mon Jun 7 06:39:52 EDT 2021


Tal Einat <taleinat+python at gmail.com> added the comment:

> 1) trailing whitespace (' ' and '\t' at least) is removed before this function is called.  I presume in IDLE rather than code.II, but cannot find where.  It is not with .rstrip.

You're probably looking for this code in EditorWindow.newline_and_indent_event():

# Strip whitespace after insert point.
while text.get("insert") in " \t":
    text.delete("insert")

See: https://github.com/python/cpython/blob/89e50ab36fac6a0e7f1998501f36fcd2872a6604/Lib/idlelib/editor.py#L1390

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44325>
_______________________________________


More information about the Python-bugs-list mailing list