Python itself doesn't appear to follow that principle:<div><br><div><div>>>> "Ain't nothin' stoppin' this from usin' \"double quotes\"." </div><div>'Ain\'t nothin\' stoppin\' this from usin\' "double quotes".'</div>
<div><br></div><div>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.</div>
<div><br></div><div>Dave Borowitz</div><br><div class="gmail_quote">On Mon, May 12, 2008 at 5:00 PM, <<a href="mailto:skip@pobox.com">skip@pobox.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
>>>>> "Benji" == Benji York <<a href="mailto:benji@zope.com">benji@zope.com</a>> writes:<br>
<br>
Benji> One such entry could be "Do what python does.":<br>
<div class="Ih2E3d"><br>
>>> 'I am a string.'<br>
'I am a string.'<br>
>>> "I'm a string"<br>
"I'm a string"<br>
<br>
</div>That would be the principle of fewest backslashes. ;-)<br>
<br>
Skip<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/ddborowitz%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/ddborowitz%40gmail.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>It is better to be quotable than to be honest.<br> -Tom Stoppard<br><br>Borowitz
</div></div>