title: Alternative to nested classes?
body: <p>I'm using nested classes to structure my data and data specific functions (can't get indentation right in the code snippet, sorry):</p>
  
  <pre><code>class test:
      class AA:
          def __init__(self):
              self.name = "ZZ-top"
              self.flag = False
          def reset(self):
              self.name = "AArdvark"
              self.flag = True
      class BB:
          def __init__(self):
              self.num = 11
          def checker(self):
              if self.num &gt; 10:
                  test.AA.name = "Toasty"                     
      def __init__(self):
          self.AA = self.AA()
          self.BB = self.BB()
  </code></pre>
  
  <p>For me this is the neatest, easiest way to segregate my data by class. I often have the same data coming from different sources and would like to have that represented. Eg. data.image.latitude and data.csv.latitude. I would also like to have functions that get or set data from multiple classes. Eg: checker function.</p>
  
  <p>The problem is python doesn't seem to like nested classes. I'm running into trouble with pickle (Can't pickle class 'test.BB.num'. This seems to be a common pickle/nested class problem) and some functions that want info on neighbouring classes don't work. I guess I have to abandon the nested classes.</p>
  
  <p>What is the python'esque correct way of structuring this data? Should I just have one monstrously big class (self.AA_timeofday ... self.ZZ_timeofday) with all the functions in it or is there something better? </p>