sets.filter?

John J. Lee jjl at pobox.com
Wed Jun 25 19:07:15 EDT 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