What's the word on using """ to comment-out?

CM cmpython at gmail.com
Wed Feb 24 17:41:03 EST 2010


> After all, from what I've seen since then, the practice of
> triple-quote-commenting (or TQC, pardon the TCA) is in fact quite
> common.
>
> Is TQC OK after all?
>
> If not, what's the case against it?

I have no sense of how approved it is, and don't have a strong opinion
on it, but I would think that some cases against it could be:

- It's used for docstrings, so when you scan code it is harder to
instantly find comment blocks or docstrings if IDE parsers color code
comments differently than docstrings.  An IDE I use (Boa Constructor)
uses "# XXX [comment]" as a comment that means "add to the to-do list"
as well.

- If you want to search for comments easily, you can search for #,
which will probably only bring you to comments, whereas if you search
for quote marks, they could be used in a number of different ways in
the code.

- Adhering to coding conventions is a good thing in open source
applications.





More information about the Python-list mailing list