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

Gerrit Holl <gerrit at> 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))


More information about the Python-list mailing list