[New-bugs-announce] [issue41184] Reconciling IDLE's Comment Out Region / Uncomment Region with PEP 8 guidelines for commenting

Anthropologist report at bugs.python.org
Wed Jul 1 11:24:15 EDT 2020


New submission from Anthropologist <python at anthropo.org>:

IDLE's Comment Out Region formatting tool currently adds two octothorpe characters followed by no spaces.  The Uncomment Region tool removes up to 2 octothorpes but does not remove spaces. 

The Python Style Guide (PEP 8) specifies that: "An inline comment is a comment on the same line as a statement. Inline comments should be separated by at least two spaces from the statement. They should start with a # and a single space."

I propose reconciling these conflicting approaches to commenting out code, either by changing IDLE's behavior (i.e., instead of ##, Comment Out Region should insert # followed by a space, per PEP 8), or by amending the Python Style Guide to provide clear instructions about commenting out code, which is arguably a different use of comments than a single-line comment for the sake of explaining code. 

If the resolution involves changing IDLE's behavior, the Uncomment Region feature should also be changed to remove the space character after the octothorpe. As it currently stands, this feature fails to uncomment code that has been manually commented out following the guidelines in PEP 8.

----------
assignee: docs at python
components: Documentation, IDLE
messages: 372757
nosy: anthropologist, docs at python, terry.reedy
priority: normal
severity: normal
status: open
title: Reconciling IDLE's Comment Out Region / Uncomment Region with PEP 8 guidelines for commenting
type: behavior
versions: Python 3.8

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


More information about the New-bugs-announce mailing list