title: Printing named tuples
body: <p>In Python 2.7.1 I can create a named tuple:</p>
  
  <pre><code>from collections import namedtuple
  Test = namedtuple('Test', ['this', 'that'])
  </code></pre>
  
  <p>I can populate it:</p>
  
  <pre><code>my_test = Test(this=1, that=2)
  </code></pre>
  
  <p>And I can print it like this:</p>
  
  <pre><code>print(my_test)
  </code></pre>
  
  <blockquote>
    <blockquote>
      <p>Test(this=1, that=2)</p>
    </blockquote>
  </blockquote>
  
  <p>but why can't I print it like this?</p>
  
  <pre><code>print("my_test = %r" % my_test)
  </code></pre>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>TypeError: not all arguments converted during string formatting</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p><strong>Edit:</strong>
  I should have known to look at <a href="https://stackoverflow.com/questions/1455602/printing-tuple-with-string-formatting-in-python">Printing tuple with string formatting in Python</a></p>