title: Python: most idiomatic way to convert None to empty string?
body: <p>What is the most idiomatic way to do the following?</p>
  
  <pre><code>def xstr(s):
      if s is None:
          return ''
      else:
          return s
  
  s = xstr(a) + xstr(b)
  </code></pre>
  
  <p><strong>update:</strong> I'm incorporating Tryptich's suggestion to use str(s), which makes this routine work for other types besides strings.  I'm awfully impressed by Vinay Sajip's lambda suggestion, but I want to keep my code relatively simple.</p>
  
  <pre><code>def xstr(s):
      if s is None:
          return ''
      else:
          return str(s)
  </code></pre>