Group comment

Chema Cortes ch3m4 at ch3m4.org
Mon Mar 1 10:32:37 EST 2004


Skip Montanaro <skip <at> pobox.com> writes:

> Many people use triple-quoted strings for this:
> 
>     """
>     i=1
>     i+=1
>     print i
>     print i+1
>     """
> 
> It's not a comment, strictly speaking, however it generally achieves the
> desired results.

But as colateral effect it will be interpreted like a doc string. It's better to
make it as a tuple:

     ("""
     i=1
     i+=1
     print i
     print i+1
     """)

or, like a hybrid:

     if 0:"""
     i=1
     i+=1
     print i
     print i+1
     """






More information about the Python-list mailing list