Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > sets.filter?

Reply
Thread Tools

sets.filter?

 
 
Gerrit Holl
Guest
Posts: n/a
 
      06-25-2003
Hi,

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?

yours,
Gerrit.

--
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/

 
Reply With Quote
 
 
 
 
Jeremy Fincher
Guest
Posts: n/a
 
      06-26-2003
Gerrit Holl <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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.

Jeremy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments