title: Python: Quick and dirty datatypes (DTO)
body: <p>Very often, I find myself coding trivial datatypes like</p>
  
  <pre class="lang-py prettyprint-override"><code>class Pruefer:
      def __init__(self, ident, maxNum=float('inf'), name=""):
          self.ident  = ident
          self.maxNum = maxNum
          self.name   = name
  </code></pre>
  
  <p>While this is very useful (Clearly I don't want to replace the above with anonymous 3-tuples), it's also very boilerplate. </p>
  
  <p>Now for example, when I want to use the class in a dict, I have to add more boilerplate like</p>
  
  <pre class="lang-py prettyprint-override"><code>    def __hash__(self):
          return hash(self.ident, self.maxNum, self.name)
  </code></pre>
  
  <p>I admit that it might be difficult to recognize a general pattern amongst all my boilerplate classes, but nevertheless I'd like to as this question: </p>
  
  <ul>
  <li><p>Are there any
  popular idioms in python to derive quick and dirty datatypes with named accessors? </p></li>
  <li><p>Or maybe if there are not, maybe a Python guru might want to show off some metaclass hacking or class factory to make my life easier?</p></li>
  </ul>