Coding Style: Quotes

Oren Tirosh oren-py-l at hishome.net
Thu Sep 12 16:47:10 CEST 2002


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. A look through the standard
> library reveals the choice of one over the other is rather arbitrary. I
> suspect it really makes no difference, but the question has come up during a
> code review.

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.

	Oren




More information about the Python-list mailing list