title: How to add code snippets to python docstring (not as doctest)?
body: <p><strong>I would like to</strong> provide code snippets to show-case how one could use a particular method or class in python. How can I do that?</p>
  
  <p><strong>In Java</strong> one could use <code>&lt;pre&gt; ... &lt;/pre&gt;</code> to do so.</p>
  
  <p><strong>Doctest is the only way?</strong>
  As I look at the existing docstrings for typical packages (e.g., pandas, numpy, etc), I never see anything other than doctest which is intended to test the method and not just to format text as python code. So, if doctest is the only way, what would be the proper way of formatting a snippet of code to look like interactive python sessions? I don't want to write my code in an interactive session each time and then c+p it in my docstring. It doesn't seem to be right.</p>