<p></p>
<p>Sorry to revive an old discussion, but I think this is a misinterpretation of PEP8, and that you may want to consider <strong>reverting <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="272506019" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/1682" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/1682/hovercard" href="https://github.com/geany/geany/pull/1682">#1682</a>.</strong>  PEP8 refers exclusively to <em>descriptive</em> comments, not commented-out code.</p>
<p>PEP8 makes these statements about comments which shows that they aren't referring to commented-out code (and which cannot possibly be applied to commented-out code):</p>
<ul>
<li><em>"Comments should be complete sentences."</em>  A commented-out line of code is a Python statement, not an English sentence.</li>
<li><em>"The first word should be capitalized, unless it is an identifier that begins with a lower case letter."</em>  Commented-out code is <em>always</em> going to start with an identifier (or a keyword), so this requirement would never apply.</li>
<li><em>"Comments that contradict the code are worse than no comments.  Always make a priority of keeping the comments up-to-date when the code changes."</em>  By its nature, commented-out code <em>precisely</em> contradicts the actual code, as it is a line of code that is <em>not</em> interpreted; it has been removed from the program or replaced by something else; so what that line describes is not part of the program.</li>
</ul>
<p>The main reason I think <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="272506019" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/1682" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/1682/hovercard" href="https://github.com/geany/geany/pull/1682">#1682</a> should be reverted is also (probably) the reason why PEP8 recommends adding a space after the #: that space <em>improves</em> readability of the comment, but for commented-out code you'd rather want to <em>"obscure"</em> it.  I find that removing that space has precisely that "psychological effect".<br>
For example, if I see</p>
<div class="highlight highlight-source-python"><pre><span class="pl-c">#return length</span></pre></div>
<p>my brain sort of "chokes" on that weird <code>#return</code> "word", and my natural reaction is to ignore the rest as gibberish.<br>
But if I see something readable, like</p>
<div class="highlight highlight-source-python"><pre><span class="pl-c"># Return the length</span></pre></div>
<p>that "passes the filter" and my natural reaction is to read the rest.</p>
<p>For this reason, I've somehow gotten used to distinguish comments and commented-out code based on whether there is a space or not.  So if I see</p>
<div class="highlight highlight-source-python"><pre><span class="pl-c"># return 0</span></pre></div>
<p>that looks to me as a descriptive comment rather than commented-out code, whereas any of</p>
<div class="highlight highlight-source-python"><pre><span class="pl-c">#return 0</span>
<span class="pl-c">#~ return 0</span></pre></div>
<p>look like commented-out lines of code.<br>
And</p>
<div class="highlight highlight-source-python"><pre><span class="pl-c"># ~ return 0</span></pre></div>
<p>looks just weird.</p>
<p>This convention seems to be used extensively in Linux config files such as .bashrc and /etc/default/grub, where descriptive comments always start with #-space, and commented-out lines that users may want to uncomment always start with a single # and no space.<br>
Personally I think this distinction is good practice, and have set it that way in <code>filetypes.python</code> myself, but I think this should be the default behavior.</p>
<p>What do you think?</p>
<p>(PS: One argument against this is if users use the "Comment Line(s)" feature to quickly create block comments after typing the whole paragraph without #'s, but I don't think people do that often... do they?)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1681#issuecomment-922802580">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ46EZJKCHMPZXJVNKLUC4EGTANCNFSM4EC6QAUA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ7LQ6DXJLKJH3X5MCTUC4EGTA5CNFSM4EC6QAUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG4ANTFA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/1681#issuecomment-922802580",
"url": "https://github.com/geany/geany/issues/1681#issuecomment-922802580",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>