[Python-ideas] Multi-line comment blocks.

David Gates gatesda at gmail.com
Sat Jun 16 02:28:39 CEST 2012


Perl, Ruby, Lisps, OCaml, F#, Haskell, and I believe Pascal.  There are
probably others.  None of these use significant indentation; they're just
smart enough to not ignore beginning delimiters within multi-line comments.

On Fri, Jun 15, 2012 at 5:47 PM, Guido van Rossum <guido at python.org> wrote:

> On Fri, Jun 15, 2012 at 4:07 PM, Carl Meyer <carl at oddbird.net> wrote:
> > On 06/15/2012 04:51 PM, Guido van Rossum wrote:
> >> On Fri, Jun 15, 2012 at 3:47 PM, David Gates <gatesda at gmail.com> wrote:
> >>> My proposal wasn't for people who hand-code the single-line comment
> syntax
> >>> but for those that use multi-line string comments.  Since the
> multi-line
> >>> string hack's BDFL-approved, people will use it and other people will
> have
> >>> to deal with it.
> >>
> >> What's wrong with it?
> >
> > The reason I discourage using multi-line strings as comments is that
> > they don't nest (which I think David mentioned earlier). If you've got a
> > short multi-line-string-as-comment in the middle of a function, and then
> > you try to use multi-line-string technique to comment out that entire
> > function, you don't get what you want, you get a syntax error as your
> > short comment is now parsed as code.
> >
> > (FWIW, I don't think this means Python needs a dedicated syntax for
> > multi-line comments, I think multiple lines beginning with # works just
> > fine.)
>
> In which languages do multi-line comments nest? AFAIK not in the
> Java/C/C++/JavaScript family.
>
> --
> --Guido van Rossum (python.org/~guido)
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120615/8fb3d484/attachment.html>


More information about the Python-ideas mailing list