Description
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