commenting out blocks of code

Jean-Paul Calderone exarkun at divmod.com
Fri Feb 17 21:09:12 EST 2006


On Sat, 18 Feb 2006 12:36:06 +1100, Steven D'Aprano <steve at removethiscyber.com.au> wrote:
> [snip]
>
>Commenting and uncommenting should be two different commands: the whole
>point of nested comments is that it allows you to comment a block of text
>which may already contain comments. Having one command do both commenting
>and uncommenting according to the presence or absence of semantic clues in
>the text is a recipe for failure ("No you stupid computer, I want to
>COMMENT that block, not uncomment it!!!").
>
>Imagine if your text editor used cntl-C for both copy and paste, somehow
>guessing whether you wanted to copy selected text or paste over it
>according to some subtle clue in the text itself. Wouldn't that be fun?
>

emacs' comment-dwim (M-;) has never guessed incorrectly, in my experience.  Of course, if it ever does, I can always invoke comment-region or uncomment-region, as appropriate.

>
>
>--
>Steven.
>
>--
>http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list