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?
2. If any one bring an accusation against a man, and the accused go to
the river and leap into the river, if he sink in the river his accuser
shall take possession of his house. But if the river prove that the
accused is not guilty, and he escape unhurt, then he who had brought the
accusation shall be put to death, while he who leaped into the river shall
take possession of the house that had belonged to his accuser.
-- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering: http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien: http://www.sp.nl/
Gerrit Holl <> wrote in message news:<mailman.1056577245.15021.python->...
> 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?
Yes, it'd be a great idea. filter/map/reduce should've been methods
on sequences from the beginning.