title: Filtering a list of dictionaries
body: <p>I have a list of identical dictionaries</p>
  
  <pre><code>list_dict = [{'id': 1}, {'id': 2}, {'id': 3}]
  </code></pre>
  
  <p>Now I want to filter a particular dictionary with value of id say id = 2</p>
  
  <p>I do</p>
  
  <pre><code>list_filtered = [ dict for dict in list_dict if dict['id'] == 2]
  </code></pre>
  
  <p>Above solution works but what if I have a very long list it will inefficient to iterate over the whole list and check if id matches. Any other workarounds?</p>