title: How to create a custom string representation for a class object?
body: <p>Consider this class:</p>
  
  <pre><code>class foo(object):
      pass
  </code></pre>
  
  <p>The default string representation looks something like this:</p>
  
  <pre><code>&gt;&gt;&gt; str(foo)
  "&lt;class '__main__.foo'&gt;"
  </code></pre>
  
  <p>How can I make this display a custom string?</p>