choice between quotes thoughts

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Aug 14 09:45:10 EDT 2001


Thu, 9 Aug 2001 15:32:09 +0400 (MSD), Roman Suzi <rnd at onego.ru> pisze:

> After some time working with Python I noticed that
> I use "-s and '-s according to the following rule:

I use a different rule:

I use "" quotes when the string represents a piece of text, usually
in a human language. These strings have an encoding, possibly are in
Unicode, and are usually intended to be displayed.

I use '' quotes when the string represents an unique symbol, tag, or
token drawn from a fixed set. For this purpose I would use symbols in
Lisp and an enumeration type in some other languages. They would be
rendered using a typewriter font on paper. Often the string value is
not important, only being different from different strings, and it's
displayed only for debugging. This extends to other technical strings
like HTML tags, method names, configuration option names, even URLs.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list