title: How can I make my class pretty printable in Python?
body: <p>Python has a pretty printer (<code>pprint(...)</code>). I would like to make my classes pretty printable. Will pretty print print my instances in a better way, if I provide a certain interface?</p>
  
  <p>The Python documentation in section <a href="https://docs.python.org/3/library/pprint.html" rel="noreferrer">8.11</a> shows different examples, but no example how to make a user defined class pretty printable.</p>
  
  <p><strong>So what interface need my classes to provide?</strong><br>
  Is there any other (maybe better) formatter?</p>
  
  <hr>
  
  <p><strong>Use Case:</strong></p>
  
  <p>I want to pretty print the content of <a href="https://docs.python.org/3.6/library/configparser.html" rel="noreferrer">ConfigParser</a>, for which I have create an extended version called <a href="https://github.com/Paebbels/ExtendedConfigParser?ts=2" rel="noreferrer">ExtendenConfigParser</a>. So I have the possibility to add more functionality or add a matching pretty print interface.</p>