Coding Style: Quotes
Michael Stenner
mstenner at phy.duke.edu
Thu Sep 12 10:53:05 EDT 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.
Since there is no "physical" difference between them, I can't imagine
why it would matter. The only reason there "needs" to be two is for
nested quoting. Sure, it would be annoying to alternate for each
string, but beyond that...
Personally, my use tends to be c/perl influenced. I use single quotes
for short static things and double quotes for longer things and format
strings.
f['key'] = "This is a long string, but it's just _my_ style..."
-Michael
--
Michael Stenner Office Phone: 919-660-2513
Duke University, Dept. of Physics mstenner at phy.duke.edu
Box 90305, Durham N.C. 27708-0305
More information about the Python-list
mailing list