[Python-checkins] r62916 - sandbox/trunk/release/release.py

Guido van Rossum guido at python.org
Fri May 9 05:00:04 CEST 2008


On Thu, May 8, 2008 at 6:48 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> <random fact>
> I only realised a couple of months ago *why* I prefer to use double-quotes
> for string literals. Aside from the fact of having a C/C++ background (where
> you don't have a choice - you have to use double-quotes for string
> literals), it's almost entirely due to the fact that using an *apostrophe*
> in a string literal is really common, but using an actual quote mark is
> quite rare.
>
> Because I habitually use double-quotes on strings, the
> single-quote/apostrophe becomes just another character. When I've written or
> worked on code that uses primarily single-quoted strings, using an
> apostrophe is a pain, because I either have to escape it or change the quote
> markers for the string (and then that string is inconsistent with the other
> strings in the code).
> </random fact>

OTOH, when generating HTML or XML, double quotes are much more common
in strings, so suddenly single quotes are more attractive as
delimiters. :-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list