title: Json not serializable in Python
body: <p>I have a list of objects in this format as below. I wanted to save it in a json file format.</p>
  
  <pre><code>{'result': [{'topleft': {'y': 103, 'x': 187}, 'confidence': 0.833129, 'bottomright': {'y': 375, 'x': 271}, 'label': 'person'}]}
  </code></pre>
  
  <p>I was able to print the objects as above. But, when I try to save it in JSON format. I encounter error "raise TypeError(repr(o) + " is not JSON serializable")"</p>
  
  <p>Here's part of my code:</p>
  
  <pre><code>def writeToJSONFile(data):
      filePathNameWExt = '/media/test/abc.json'
      with open(filePathNameWExt, 'w') as fp:
          json.dump(data, fp)
  
  result = tfnet.return_predict(img)
  data['result']=result
  print (data)   
  writeToJSONFile(data)
  </code></pre>