title: Writing string representation of class instance to file
body: <p>I have defined the <code>__str__</code> and <code>__repr__</code> in my <code>class foo</code><br />
  When I <code>print foo()</code>, it works just fine.<br />
  Of course, redefining stdout as a <code>file</code> object and calling <code>print foo()</code> would write the string representation to the file, but is that the most pythonic way to do it?<br /></p>