**kwargs search mechanism in an object (python)
<p>Want to be able to provide a search interface for a collection of objects to be used by passing a list of keyword arguments like so:</p>

<pre><code>playerID = players.search(nameFirst='ichiro', nameLast='suzuki')
</code></pre>

<p>Where players.search is defined like so:</p>

<pre><code>def search(self, **args):
 ret = []
 for playerID, player in self.iteritems():
  for key, value in args.iteritems():
   if getattr(player, key) == value:
    ret.append(player.playerID)

 return ret
</code></pre>

<p>Obviously the above code doesn't work. I want to, to borrow some SQL idioms, to work like where player.key == value and player.keyN = valueN, and so on for N number of kwargs passed.</p>

<p>Any ideas? Thanks!</p>
