title: How to compare two JSON objects with the same elements in a different order equal?
body: <p>How can I test whether two JSON objects are equal in python, disregarding the order of lists?</p>
  
  <p>For example ...</p>
  
  <p>JSON document <strong>a</strong>:</p>
  
  <pre><code>{
      "errors": [
          {"error": "invalid", "field": "email"},
          {"error": "required", "field": "name"}
      ],
      "success": false
  }
  </code></pre>
  
  <p>JSON document <strong>b</strong>:</p>
  
  <pre><code>{
      "success": false,
      "errors": [
          {"error": "required", "field": "name"},
          {"error": "invalid", "field": "email"}
      ]
  }
  </code></pre>
  
  <p><code>a</code> and <code>b</code> should compare equal, even though the order of the <code>"errors"</code> lists are different.</p>