Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
raw string
#3
A raw string cannot end in a single or odd \'s.

Quote:Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result; for example, r"\"" is a valid string literal consisting of two characters: a backslash and a double quote; r"\" is not a valid string literal (even a raw string cannot end in an odd number of backslashes). Specifically, a raw literal cannot end in a single backslash (since the backslash would escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the literal, not as a line continuation.

Ref: https://docs.python.org/3/reference/lexi...s-literals at the end of the subsection.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
raw string - by Skaperen - Jan-10-2018, 02:43 AM
RE: raw string - by Gribouillis - Jan-10-2018, 08:48 PM
RE: raw string - by wavic - Jan-10-2018, 09:27 PM
RE: raw string - by Skaperen - Jan-11-2018, 04:58 AM
RE: raw string - by Gribouillis - Jan-11-2018, 06:56 AM
RE: raw string - by Skaperen - Jan-11-2018, 08:35 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020