Why is it that str.replace doesn't work sometimes?

John Machin sjmachin at lexicon.net
Wed Jun 24 20:56:24 EDT 2009


On Jun 25, 7:17 am, Lie Ryan <lie.1... at gmail.com> wrote:
> MRAB wrote:
> > There's no difference between the two types of quote character.
>
> a small exception is single-quote can contain double quote but cannot
> contain unescaped single quote while double-quote can contain single
> quote but cannot contain unescaped double quote.

Refinement 1:
S can contain D but cannot contain unescaped S
D can contain S but cannot contain unescaped D

Refinement 2:
for Q in list_of_defined_quote_characters:
    Q can contain non-Q but cannot contain unescaped Q

I'd call that orthogonal and a similarity not a small exception to "no
difference" :-)



More information about the Python-list mailing list