[Python-ideas] Multi-line comment blocks.
gatesda at gmail.com
Fri Jun 15 18:23:39 CEST 2012
I agree that using multi-line strings as literals comes across as an ugly
hack, even if it is BDFL-approved.
Your other point is valid, though as far as I can tell it's only an issue
when the comment is indented less than it ought to be (and starts with "#:",
#: Valid either way. The next line has the
#: same level of indentation, so it's not
#: counted as part of the block.
# Causes an IndentationError in existing code.
#: This one would break.
On Fri, Jun 15, 2012 at 8:04 AM, Robert Kern <robert.kern at gmail.com> wrote:
> On 6/15/12 11:49 AM, Sven Marnach wrote:
>> Robert Kern schrieb am Fri, 15. Jun 2012, um 10:50:40 +0100:
>>> Multi-line string literals aren't comments. They are multi-line
>>> string literals. Unlike a comment, which does not show up in the
>>> compiled bytecode, the Python interpreter actually does something
>>> with those string literals. Sometimes people abuse them as ways to
>>> poorly emulate block comments, but this is an abuse, not a feature
>>> of the language.
>> Multi-line string literals do not generate code in CPython, and their
>> use as comments has BDFL approval:
> Well fancy that.
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless
> that is made terrible by our own mad attempt to interpret it as though it
> an underlying truth."
> -- Umberto Eco
> Python-ideas mailing list
> Python-ideas at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas