Coding Style: Quotes
mcherm at destiny.com
Thu Sep 12 22:08:13 CEST 2002
Oren Tirosh wrote:
> On Thu, Sep 12, 2002 at 02:25:11PM +0000, John Waycott wrote:
>>I'm curious if others have adopted any standards for choice of single vs.
>>double quotation marks to delimit strings. [...]
> The default repr of a string uses single quotes unless the string
> contains a single quote. Most of the time I use the same convention but
> I'm not 100% consistent.
> For docstrings I always use triple double-quotes even if the docstring
> fits in a single line.
> I use triple single-quotes to comment out blocks of code. This is very
> useful since "if 0:" would require re-indentation.
Encouragingly, I use EXACTLY the same conventions and practices that
Oren does, having developed them independently for the same reasons.
-- Michael Chermside
More information about the Python-list