Clark Maurer wrote:
I just don’t understand the rationale for the current implementation. I thought the intention of raw strings was to allow for backslashes in the string.
That's not *exactly* true. The intention is to allow backslashes that are *being used to escape something*, but are to be interpreted by whatever is using the string, not by Python itself. The original use case was regular expressions, I believe. In that case, there is no need to be able to put a backslash at the end of a string. Your suggestion of doubling quotes would actually interfere with this use case, because currently you can write r"a\"b" and it will be correctly interpreted as a regular expression with an escaped quote in it. Under your scheme, it would have to be written r"a\""b" and then it would no longer be WYSIWYG. -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing@canterbury.ac.nz +--------------------------------------+