sets.filter?

John J. Lee jjl at pobox.com
Thu Jun 26 01:07:15 CEST 2003


Gerrit Holl <gerrit at nl.linux.org> writes:

> would it be a good idea to add a .filter() method to a set object,
> which behaves like the builtin filter() but resulting in a set?
> I often see myself doing sets.Set(filter(f, someset))... Would this
> be a good addition to sets.Set?

import sets
def setfilter(f, s): return sets.Set(filter(f, s))


John




More information about the Python-list mailing list