title: write json float in scientific notation
body: <p>I would like to represent floats in a JSON file in scientific notation using Python 3.6+. None of</p>
  
  
  
  <pre><code>import json
  
  a = 0.001234567
  
  print(json.dumps(a))
  
  json.encoder.FLOAT_REPR = lambda x: "{:e}".format(x)
  print(json.dumps(a))
  
  json.encoder.c_make_encoder = None
  json.encoder.FLOAT_REPR = lambda x: "{:e}".format(x)
  print(json.dumps(a))
  </code></pre>
  
  <p>work: All three <code>print</code>s give</p>
  
  <pre><code>0.001234567
  </code></pre>
  
  <p>instead of the desired</p>
  
  <pre><code>1.234567e-03
  </code></pre>
  
  <p>(Note that the last version works at least in in Python 2.7.15rc1.)</p>
  
  <p>The answer should work with lists of <code>float</code>s as well.</p>
  
  <p>Any hints?</p>