Skip to content

IDLE: <<comment-region>> didn't obey with PEP8 #94522

Closed as not planned
Closed as not planned
@znsoooo

Description

@znsoooo

Feature or enhancement

IDLE default use Alt+3 to make region commented, and use Alt+4 to uncomment.

But event <<comment-region>> only add "##" at every start of line, but PEP8 said comment should start with ONE "#" and at least with one SPACE.

Further, if a comment with spaces before "#", like "    ##code", <<uncomment-region>> can't uncomment this region.

Pitch

In most IDEs/editors, comments can be added or removed with ONE single shortcut. I have completed an implementation at behind link.

Do we need to combine these two shortcut keys (Alt+3 and Alt+4) into one shortcut key? The logic is that detect region whether if commented, do comment region if at least one line is uncomment, and remove (one level of) comment if region is comment.

Implementation: https://github.com/znsoooo/IDLE-Advance/blob/master/idlealib/AutoComment.py

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions