John Machin <sjmac...@lexicon.net> writes: > On Oct 31, 11:23 pm, Yingjie Lan <lany...@yahoo.com> wrote: > > Thanks! That looks weird to me ... doesn't this contradict with: > > > > All backslashes in raw string literals are interpreted literally. > > (seehttp://docs.python.org/release/3.0.1/whatsnew/3.0.html): > > All backslashes in syntactically-correct raw string literals are > interpreted literally.
That's a good way of putting it. Yingjie, in case it's not clear: Python can only know what you've written if it's syntactically correct. The backslash preceding the final quote means that the code contains bad syntax, not a raw string literal. Since there's no raw string literal, “backslashes in raw string literals” doesn't apply. -- \ “If sharing a thing in no way diminishes it, it is not rightly | `\ owned if it is not shared.” —Augustine of Hippo (354–430 CE) | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list