title: How can I filter items from a list in Python?
body: <p>I have data naively collected from package dependency lists.</p>
  
  <p>Depends:  foo bar baz >= 5.2</p>
  
  <p>I end up with </p>
  
  <pre><code> d = set(['foo','bar','baz','&gt;=','5.2'])
  </code></pre>
  
  <p>I don't want the numerics and the operands.</p>
  
  <p>In Perl I would</p>
  
  <pre><code>@new = grep {/^[a-z]+$/} @old
  </code></pre>
  
  <p>but I can't find a way to e.g. pass remove() a lambda, or something.</p>
  
  <p>The closest I've come is ugly: </p>
  
  <pre><code>[ item != None for item in [ re.search("^[a-zA-Z]+$",atom)   for atom in d] ]
  </code></pre>
  
  <p>which gets me a map of which values out of the set I want...<em>if</em> the order of the set is repeatable?  I know that's not the case in Perl hashes.</p>
  
  <p>I know how to iterate.  :)   I'm trying to do it the pythonesque Right Way</p>