title: __str__ and pretty-printing (sub)dictionaries
body: <p>I have an object that consists primarily of a very large nested dictionary:</p>
  
  <pre><code>class my_object(object):
      def __init__(self):
          self.the_dict = {}  # Big, nested dictionary
  </code></pre>
  
  <p>I've modified __ str__ to pretty-print the top-level dictionary by simply "printing" the object:</p>
  
  <pre><code>    def __str__(self):
          pp = pprint.PrettyPrinter()
          return pp.pformat(self.the_dict)
  </code></pre>
  
  <p>My goal here was to make the user's life a bit easier when he/she peruses the object with IPython:</p>
  
  <pre><code>print(the_object)  # Pretty-prints entire dict
  </code></pre>
  
  <p>This works to show the user the entire dictionary, but I would like to expand this functionality to sub-portions of the dictionary as well, allowing the user to get pretty-printed output from commands such as:</p>
  
  <pre><code>print(the_object.the_dict['level1']['level2']['level3'])
  </code></pre>
  
  <p>(would pretty-print only the 'level3' sub-dict)</p>
  
  <p>Is there a straight-forward way to use __ str__ (or similar) to do this?</p>