title: Namedtuple vs Dictionary
body: <p>So I'm programming a game and I need a datatype that can store a multitude of variables ranging from <code>lists</code>, <code>tuples</code>, <code>strings</code> and <code>integers</code>. I'm torn between using either <code>dictionaries</code> or <code>namedtuples</code>. </p>
  
  <pre><code>GameData = namedtuple('GameData', ['Stats', 'Inventory', 'Name', 'Health'])
  current_game = GameData((20,10,55,3), ['Sword', 'Apple', 'Potion'], 'Arthur', 100)
  
  GameData = {'Stats': (20,10,55,3), 'Inventory': ['Sword', 'Apple', 'Potion'], 'Name': 'Arthur', 'Health': 100}
  </code></pre>
  
  <p>You see, the biggest problem here is all of these values may change, so I need a mutable datatype, which is not the <code>namedtuple</code>. Looking in the docs, <code>namedtuples</code> appear to have <code>._replace()</code>, so does that make it mutable?</p>
  
  <p>I also like how <code>namedtuples</code> have a <code>__repr__</code> method that prints in the <code>name=value</code> format. Also, the functionality of assigning separate <code>__doc__</code> fields to each value in the <code>namedtuple</code> is very useful. Is there this functionality with <code>dictionaries</code>?</p>