New submission from Anthropologist <pyt...@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@python
components: Documentation, IDLE
messages: 372757
nosy: anthropologist, docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41184>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to