Most discussions of raw strings (including the introduction in Section 2.4.1 of the official documentation) state that backslashes in raw strings are treated literally, rather than being interpreted as the first character of an escape sequence with a special meaning (\t, \n, etc.).
Yet, as stated in the last para of Section 2.4.1, “Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result.”
Why was an exception made for the quote characters? And then, why does the backslash remain in the result? Why can’t a string containing just the backslash character be represented as r’’, r"" or r""""""? If I need to include some kind of quote in a raw string, I could always use a different kind of quote as the string delimiter (e.g. " ’ ").
To me, all this goes absolutely against the “principle of least surprise”, so I’m guessing I must be missing something, and that there must have been extensive(?) discussion about this within the Python developer community. I’d be grateful if someone could please point me to that discussion. Or to a forum that’s more appropriate for this question.