Comments
Chris
aussie2010 at yahoo.com
Wed Apr 2 13:52:06 EST 2003
"Terry Reedy" <tjreedy at udel.edu> wrote in message news:<sKSdnfwAUb0mrxejXTWcog at comcast.com>...
> > What are the reasons for not having multi-line comments?
>
> Because we more or less have them already -- the compiler can dump '''
> ''' strings that are not assigned to anything or otherwise used.
>
> > I just remembered that IDLE will color-code """ as a string and not
> a
> > comment - even when it is intended only as a comment.
>
> Unlike the compiler, IDLE does not know the differrence.
But if there were multi-line comments everything would display with
the correct color code, in IDLE, or Emacs, etc.
>
> Once could propose that ###, for instance, delimit multiline comments,
> but I suspect Guido would say, "Why bother?".
I believe I read that the forced indentation of Python was developed
after work done with beginning and/or casual programmers. In that
vein, commmenting out code would best be implemented by the use of
multi-line comments, and not "if 0:" or """ ... """. It can't be that
big of a change - the logic would seem to be almost identical to the
""" logic, except that you always discard the string, rather than
sometimes assigning it to a variable.
I would go with /* */ since it is already the multi-line comment in at
least 4 languages - Java, C, C++, Rexx (interpreted).
>
> TJR
More information about the Python-list
mailing list