Tim Peters <t...@python.org> added the comment:

To include trailing whitespace on a line in a doctest, _don't_ use raw strings. 
 Use a regular string, and include add a (one or more) trailing \x20 instead of 
a space (for example).  For example:

r"""
>>> print("a ")
a 
"""

where there's a space at the end of the output line is no good.  It's visually 
impossible to tell what's intended, and the commit hook should reject it.  But 
this works fine (a regular string and an escape code):

"""
>>> print("a ")
a\x20
"""

----------
nosy: +tim.peters

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24746>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to