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