[Python-ideas] Multi-line comment blocks.

Stephen J. Turnbull stephen at xemacs.org
Sat Jun 16 08:45:23 CEST 2012


Devin Jeanpierre writes:

 > [T]riple-quoted strings have three purposes:
 > 
 > - Actual string objects
 > - Docstrings

Docstrings are a subset of "actual string objects," of course.
They just have a special syntax, and their primary use is "meta" (eg,
introspection).

 > - Comments

And so are strings-as-comments.  Strings could be used as comments in
C:

void foo ()
{
    "This comment would be optimized away, most likely.";
    "Not to mention compilers may bitch about lack of effect.";
    return 42;
}

It's just a side effect of expression statements.  You don't have to
like it, of course.



More information about the Python-ideas mailing list