title: python filtering list of dict by dict containing several key-value pairs as conditions
body: <p>my example data:</p>
  
  <pre><code>list_of_dict =[{'cena': 23, 'nazwa': 'item1', 'param': 'pampam'},
                 {'cena': 26, 'nazwa': 'item2', 'param': 'iko'   },
                 {'cena': 26, 'nazwa': 'item2a','param': 'ik2'   },
                 {'cena': 26, 'nazwa': 'item2b','param': 'ik2'   },
                 {'cena': 17, 'nazwa': 'item3', 'param': 'etr'   },
                 {'cena': 17, 'nazwa': 'item4', 'param': 'asdf'  }]
  
  conditions =   {'cena': 26, 'param': 'ik2' }
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>if conditions in list_of_dict:
      do_something()
  </code></pre>
  
  <p>it works, but only when whole conditions dict (every key) matches the one from dict list, I mean:</p>
  
  <pre><code>In [1]: exampleSet =      [{  'type' : 'type1', 'k' : 'kval'},
     ...:                    {  'type' : 'type2', 'k' : 'kv2' },
     ...:                    {  'type' : 'type2', 'k' : 'k3'  },
     ...:                    {  'type' : 'type3', 'k' : 'k3'  }]
     ...: 
     ...: conditions =       {  'type' : 'type1', 'k' : 'kval' }
     ...: 
     ...: 
     ...: conditions in exampleSet
     ...: 
  Out[1]: True
  In [2]: conditions =       {  'type' : 'type1' }
  
  In [3]: conditions in exampleSet
  Out[3]: False
  </code></pre>
  
  <p>while I am trying to match dictionaries with key-value pairs specified, (regardless of values/existence of unspecified ones) so</p>
  
  <pre><code>In [4]: exampleSet =      [{  'type' : 'type1', 'k' : 'kval'},
     ...:                    {  'type' : 'type2', 'k' : 'kv2' },
     ...:                    {  'type' : 'type2', 'k' : 'k3'  },
     ...:                    {  'type' : 'type3', 'k' : 'k3'  }]
     ...: 
     ...: conditions =       {  'type' : 'type2' }
     ...:
     ...: my_wanted_match( exampleSet, conditions )
  </code></pre>
  
  <p>has to return:</p>
  
  <pre><code>                     [{  'type' : 'type2', 'k' : 'kv2' },
                        {  'type' : 'type2', 'k' : 'k3'  }]
  </code></pre>
  
  <p>as a result.</p>
  
  <p>can anyone gimme some hints on how to achieve this?</p>