Coding Style: Quotes

Chris McDonough chrism3 at cox.net
Fri Sep 13 04:04:34 CEST 2002


I use single quotes most of the time, but that's just because I'm lazy 
and if I use single quotes I don't need to press the shift key so much. ;-)

Michael Chermside wrote:
> 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.
>>
>>     Oren
> 
> 
> 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 mailing list