[Python-Dev] On quote styles (original) (raw)

David Borowitz borowitz at cs.stanford.edu
Tue May 13 02:26:53 CEST 2008


Python itself doesn't appear to follow that principle:

"Ain't nothin' stoppin' this from usin' "double quotes"." 'Ain't nothin' stoppin' this from usin' "double quotes".'

IMHO it's a useful rule of thumb, but like most of the other alternatives presented in this thread, taken to extremes, it can get silly. (Imagine a string with 10 's and 9 "s, and adding two more "s to it...) But I suppose that's another reason these are just guidelines.

Dave Borowitz

On Mon, May 12, 2008 at 5:00 PM, <skip at pobox.com> wrote:

>>>>> "Benji" == Benji York <benji at zope.com> writes:

Benji> One such entry could be "Do what python does.": >>> 'I am a string.' 'I am a string.' >>> "I'm a string" "I'm a string" That would be the principle of fewest backslashes. ;-) Skip


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ddborowitz%40gmail.com

-- It is better to be quotable than to be honest. -Tom Stoppard

Borowitz -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20080512/06fb3ed5/attachment.htm>



More information about the Python-Dev mailing list