title: How to change python way of casting float('inf') to str?
body: <p>My app is processing numbers, and of them are pythons <code>float('inf')</code>.
  The problem is that I'd like for such number to be casted as full word: <code>&quot;Infinity&quot;</code>.</p>
  <pre><code>for x in [float('inf'), float(5.0)]:
      print(x)
  </code></pre>
  <p>Results with:</p>
  <pre><code>inf
  5.0
  </code></pre>
  <p>I would like it to be:</p>
  <pre><code>Infinity
  5.0
  </code></pre>
  <p>Can I somehow set how infinity is represented in string?</p>
  <p>Of course I could make something like method below:</p>
  <pre><code>def cast_num(num):
      if num == float('inf')
          return 'Infinity'
      else:
          return str(num)
  </code></pre>
  <p>But such method is costly - It has to process every number.</p>
  <p>Is there better alternative?</p>
  <p>Is there some flag in python which I can set? (like 'setlocale')</p>