choice between quotes thoughts

Markus Schaber markus at schabi.de
Sun Aug 12 15:27:40 CEST 2001


Hi,

François Pinard <pinard at iro.umontreal.ca> schrub:

>> After some time working with Python I noticed that I use "-s and '-s
>> according to the following rule: I use "" quotes when I specify value
>> MANUALLY. That is, in most cases.  On the other hand, I use '' where
>> quotes are generated automatically. This is consistent with repr(),
>> which gives ''.
> 
> Observing myself, I noticed that I use "..." for text meant to be
> displayed and read by a human, and '...' for more internal,
> programmatic strings. It works well for me, to the point I turned this
> into a personal style rule.

I just use "..." for strings and '...' chars (Strings containing one 
char - this comes from Java where Chars can be given this way), and """ 
for multi-line strings or strings containing " or '. I never used '''s 
up to now.

-- 
1) Customers cause problems.
2) Marketing is trying to create more customers.
Therefore:
3) Marketing is evil.  (Grand Edwards in comp.lang.python)



More information about the Python-list mailing list