[Python-ideas] Multi-line comment blocks.

Stephen J. Turnbull stephen at xemacs.org
Sat Jun 16 08:34:58 CEST 2012

Carl Meyer writes:

 > The reason I discourage using multi-line strings as comments is that
 > they don't nest (which I think David mentioned earlier).

I don't see that as a problem.

While I don't use multiline strings as comments myself, I wouldn't
object to others using them for commentary, especially given the
syntactic analogy to docstrings.  But for commenting out code, a nice
heavy line in the left margin is an appropriate marker, and would
certainly "discuss" the matter with colleagues who disabled large
chunks of code with paired delimiters, whether primarily string or
comment delimiters.  I'm a big non-fan of preprocessor conditional
compilation directives, for that matter.  (Sure, your editor can mark
or hide them, and it's not like you can avoid them in languages like
C, but that doesn't mean I have to *like* them.)

So IMO the current syntax encourages good style.

More information about the Python-ideas mailing list