I would like to point out another use case of triple quotes outside of
docstrings. We do a lot of SQL here and so doing a parameterized query like:
"""SELECT foo
FROM bar
WHERE baz = %s"""
is a whole lot cleaner and more natural than
("SELECT foo" +
"FROM bar" +
"WHERE baz = %s")
For this toy example, one could just put it all on one line, but for
rather more complicated SQL, it becomes a readability (and thus
maintainability) factor to preserve SQL's one keyword per line
formatting. So, yes, all of our SQL statements wind up in the parse tree
and that's not optimal, but the suboptimality there is less for us than
the suboptimality of the second form above.
I would welcome a multiline comment format that didn't involve docstrings.
Best,
coyot
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/6MKP4IR5STLNDPZKU6H5AVTZ7F3XAHYX/
Code of Conduct: http://python.org/psf/codeofconduct/