(original) (raw)
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@pobox.com> wrote:
>>>>> "Benji" == Benji York <benji@zope.com> writes:
Benji> One such entry could be "Do what python does.":
That would be the principle of fewest backslashes. ;-)
>>> 'I am a string.'
'I am a string.'
>>> "I'm a string"
"I'm a string"
Skip
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@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