python means that the backslash is not escaped, for example:
>>> s = r"asd\a"
>>> s
"asd\\a"
the above results are easy to understand, but not if the backslash appears at the end of the string:
>>> s = r"asd\"
File "<stdin>", line 1
s = r"asd\"
^
SyntaxError: EOL while scanning string literal
Why is there such a design? Since r means no escape, why is there an error at the end?