Iteration index

Roman Suzi rnd at onego.ru
Thu May 31 21:36:08 CEST 2001


On Thu, 31 May 2001, D-Man wrote:

>| 2. Are there block comments in Python? (like /* */ in C)
>
>Triple-Quoted-Strings technically aren't comments, but as an
>expression by themself they behave identically.  The only problem
>(with C, C++, and Java comments too) is that you can't nest them.
>Python does have 2 string delimiters, however, so you can use """ for
>strings and ''' for commented out blocks without trouble (the ''' tqs
>can be inside a """ tqs).

I think the proper way is to comment block of code like this:

## >Triple-Quoted-Strings technically aren't comments, but as an
## >expression by themself they behave identically.  The only problem
## >(with C, C++, and Java comments too) is that you can't nest them.
## >Python does have 2 string delimiters, however, so you can use """ for
## >strings and ''' for commented out blocks without trouble (the ''' tqs
## >can be inside a """ tqs).

This is what python-mode in Emacs is offering as C-c # and
it is easier to see commented code that if using """

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Thursday, May 31, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "You have to be sharp to be on the cutting edge." _/





More information about the Python-list mailing list