I believe this will have the same functionality:
def filter_nodes(self, **kwargs):
return [n for n in self.pcode
if all(getattr(n, k) == v for k, v in kwargs.iteritems())]
UPDATE: actually, it won't, it will require all the attributes to be equal with the values found in kwargs, whereas in your snippet, the last key/value pair of kwargs will decide if n can be added or not. perhaps you should specify in which exact conditions it is allowed to be added.