title: How to properly indent class variables containing classes with pprint
body: <p>I have a custom class that contains objects of another class, structured something like this (init is pre-populated for demonstration):
  </p>
  
  <pre><code>class Outer:
  
      def __init__(self, inner_class_holder=None):
          self.outer_list = [["example_list"], list(range(5))]
          self.outer_dict = dict(zip(list("abcdefghij"), range(10)))
          self.inner_class_holder = inner_class_holder
  
      def __repr__(self):
          import pprint
          return "Class " + str(self.__class__.__name__) + ":\n" + pprint.pformat(vars(self))
  
  
  class Inner:
  
      def __init__(self):
          self.inner_list = list("demo")
          self.inner_dict = dict(zip(list("nope"), range(4)))
  
      def __repr__(self):
          import pprint
          return "Class " + str(self.__class__.__name__) + ":\n" + pprint.pformat(vars(self))
  </code></pre>
  
  <p>Both contain other variables like lists and dicts that I've been able to print well with pprint.pformat() and __repr__ individually, so running the following produces the results I'd expect:
  </p>
  
  <pre><code>&gt;&gt;&gt; print(Outer())
  
  Class Outer:
  {'inner_class_holder': None,
   'outer_dict': {'a': 0,
                  'b': 1,
                  'c': 2,
                  'd': 3,
                  'e': 4,
                  'f': 5,
                  'g': 6,
                  'h': 7,
                  'i': 8,
                  'j': 9},
   'outer_list': [['example_list'], [0, 1, 2, 3, 4]]}
  
  &gt;&gt;&gt; print(Inner())
  
  Class Inner:
  {'inner_dict': {'e': 3, 'n': 0, 'o': 1, 'p': 2},
   'inner_list': ['d', 'e', 'm', 'o']}
  </code></pre>
  
  <p>However, when I try to pretty-print the outer class when it has instances of the inner class, this happens:
  </p>
  
  <pre><code>&gt;&gt;&gt; outer = Outer([Inner(), Inner()])
  &gt;&gt;&gt; print(outer)
  
  Class Outer:
  {'inner_class_holder': [Class Inner:
  {'inner_dict': {'e': 3, 'n': 0, 'o': 1, 'p': 2},
   'inner_list': ['d', 'e', 'm', 'o']},
                          Class Inner:
  {'inner_dict': {'e': 3, 'n': 0, 'o': 1, 'p': 2},
   'inner_list': ['d', 'e', 'm', 'o']}],
   'outer_dict': {'a': 0,
                  'b': 1,
                  'c': 2,
                  'd': 3,
                  'e': 4,
                  'f': 5,
                  'g': 6,
                  'h': 7,
                  'i': 8,
                  'j': 9},
   'outer_list': [['example_list'], [0, 1, 2, 3, 4]]}
  </code></pre>
  
  <p>While the "Class Inner" lines are properly indented by pprint, none of their bodies are, which makes the pprint much less helpful. Is there a way to get pprint to indent the inner objects correctly, particularly without specifically handling each variable in the class?</p>