[Python-Dev] On quote styles

Georg Brandl g.brandl at gmx.net
Sat May 10 17:51:06 CEST 2008


skip at pobox.com schrieb:
> Moving from python-checkins and giving this topic a proper subject.  The
> original thread started here with a checkin by Benjamin:
> 
>     http://mail.python.org/pipermail/python-checkins/2008-May/069181.html
> 
> While Python doesn't have a char type (yet), I still find the distinction
> between 'c' and "abc" useful to show intent (especially given my C
> background and occasional but increasingly rare dip into the CPython
> implementation).  I must admit though that I'm not as consistent with this
> as I used to be or would like to be.  I guess that's because I'm lazy and
> the byte compiler doesn't enforce that style.
> 
> I do prefer to use """ as the triple quote string delimiter because I find
> that for most of my uses it makes more sense as apostrophes tend to be the
> quote chars most frequently embedded in them (I don't do much, if any, HTML
> these days).
> 
> This is, of course, all personal preference, and definitely not
> PEP-8-able.
> 
> maybe-if-we-<wink>-uncle-timmy-will-sort-it-out-ly y'rs,

I think some people use the two string literal types to distinguish between
text (potentially translatable strings) and data. This way, it's much easier
to add i18n later if needed.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list