A simple single line, triple-quoted comment is giving syntax error. Why?
Terry Reedy
tjreedy at udel.edu
Wed Mar 18 17:47:40 EDT 2015
On 3/18/2015 3:53 PM, Thomas 'PointedEars' Lahn wrote:
> I must strongly object and recommend against getting accustomed to the
> suggested use of multi-line string literals.
I agree.
> If you want to comment your code, then by all means do so using docstrings
> and *real* comments. IDEs like PyDev support you there.
For instance, with Idle, before (with red comment coloring):
# this is
# a very very very ragged ragged ragged ragged ragged ragged ragged
# multiline comment
# that I will reformat
# with Idle's Format Paragraph (default key binding alt-Q, but this may
be reset by the user as long as the user is careful to not resuse
another key.
after alt-q anywhere in the comment block, with default 72 char lines
# this is a very very very ragged ragged ragged ragged ragged ragged
# ragged multiline comment that I will reformat with Idle's Format
# Paragraph (default key binding alt-Q, but this may be reset by the
# user as long as the user is careful to not resuse another key.
> That way also the syntax highlighting will be correct.
--
Terry Jan Reedy
More information about the Python-list
mailing list