Why """, not '''?

Matthew Woodcraft mattheww at chiark.greenend.org.uk
Wed Mar 5 18:27:21 EST 2008


Steven D'Aprano  <steve at REMOVE-THIS-cybersource.com.au> wrote:
>On Wed, 05 Mar 2008 19:19:08 +0000, Matthew Woodcraft wrote:
>> One advantage is that a dumb syntax highlighter is more likely to cope
>> well if the content includes an apostrophe.

> But if the content contains double-quote marks, the "dumb syntax 
> highligher" is more likely to cope well if you use '''.

That's right. But apostrophes are rather more common than quote marks
in English text.

> And, let's be realistic here, a "dumb syntax highlighter" is more
> likely to not cope well with triple-quote strings *at all*.

In practice they often do the right thing, what with three being an odd
number.

-M-



More information about the Python-list mailing list