Python doctest with newline characters: inconsistent leading whitespace error

The docstring docs actually allude to the problem, but not entirely clearly. A couple of other stackoverflow threads here and here were helpful, but not easy to find given my own search criteria. Here is my actual solution: def remove_CRs(text): r””” >>> output = remove_CRs(“line1 \r” … “still line1\n” … “now line2 \r” … “more … Read more