[issue31136] raw strings cannot end with a backslash character r'\'

Graham Wideman report at bugs.python.org
Wed Feb 20 21:29:54 EST 2019


Graham Wideman <initcontact at grahamwideman.com> added the comment:

Demonstration:
print("x" + r' \' ' + "x")   produces
x \' x
Where is this behavior _ever_ useful? 
Or if there is some use case for this, how frequent is it compared to the frequency of users expecting either that backslash does nothing special, or that it would behave like an escape, and not appear in the output? 

I'm not here to suggest there's some easy fix for this. I just don't want this issue closing as "not a bug" and fail to register that this design is flawed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31136>
_______________________________________


More information about the Python-bugs-list mailing list