Thomas Kluyver <[email protected]> added the comment:
I'm still a bit confused why it gets escaped - as far as I know, the escaping
only happens when you repr() a string, as the displayhook does automatically:
>>> a = """ a ' single and " double quote """
>>> a
' a \' single and " double quote '
>>> print(repr(a))
' a \' single and " double quote '
>>> print("%r" % a)
' a \' single and " double quote '
>>> print(a)
a ' single and " double quote
The warnings code doesn't appear to ever repr() the message. So I guess it's
some further bit of interaction with doctest. But unfortunately I don't have
time to dig through doctest to try and understand it.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36695>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com