[Python-Dev] Can we triple quoted string as a comment?

Guido van Rossum guido at python.org
Tue Mar 26 17:11:12 CET 2013


And I still think it's neat. :-)


On Tue, Mar 26, 2013 at 8:46 AM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 03/25/2013 02:16 PM, Victor Stinner wrote:
>
>> Hi,
>>
>> I just realized that the Python peephole optimizer removes useless
>> instructions like numbers and strings between other instructions,
>> without raising an error nor emiting an error. Example:
>>
>> $ python -Wd -c 'print "Hello"; "World"'
>> Hello
>>
>> As part of my astoptimizer project, I wrote a function to detect such
>> useless instructions which emit a warning. I opened the following
>> issue to report what I found:
>> http://bugs.python.org/**issue17516 <http://bugs.python.org/issue17516>
>>
>> Different modules use long strings as comments. What is the "official"
>> policy about such strings? Should we use strings or comments?
>>
>> (IMO a comment should be used instead.)
>>
>
> Someone will correct me if I'm wrong, I'm sure, but I believe Guido
> himself has said that a neat feature of triple-quoted strings is their
> ability to be used as comments.
>
> --
> ~Ethan~
>
> ______________________________**_________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/**mailman/listinfo/python-dev<http://mail.python.org/mailman/listinfo/python-dev>
> Unsubscribe: http://mail.python.org/**mailman/options/python-dev/**
> guido%40python.org<http://mail.python.org/mailman/options/python-dev/guido%40python.org>
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130326/824dac1f/attachment.html>


More information about the Python-Dev mailing list