title: Python doctest with newline characters: inconsistent leading whitespace error
body: <p>When writing python doctests, how does one properly introduce newline characters within a string in the test?  Here's a simple example:</p>
  
  <pre><code>def remove_newlines(text):
      """
      &gt;&gt;&gt; remove_newlines("line1 \n"
      ...                 "still line 1\r"
      ...                 "now line2 \n"
      ...                 "more line2\n")
      line1 still line1
      now line2 more line2
      """
      return text.replace('\n', '')
  
  import doctest
  doctest.run_docstring_examples(remove_newlines, globals())
  </code></pre>
  
  <p>The output of which is:</p>
  
  <pre><code>Traceback (most recent call last):
  ...
  ValueError: line 3 of the docstring for NoName has inconsistent leading whitespace: '"'
  </code></pre>