sets.filter?

Discussion in 'Python' started by Gerrit Holl, Jun 25, 2003.

  1. Gerrit Holl

    Gerrit Holl Guest

    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/
    Gerrit Holl, Jun 25, 2003
    #1
    1. Advertising

  2. Gerrit Holl <> wrote in message news:<>...
    > 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
    Jeremy Fincher, Jun 26, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Kingscott

    Shaping data/multiple result sets - hmmm...

    Mike Kingscott, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    307
    Mike Kingscott
    Aug 27, 2003
  2. randall g
    Replies:
    1
    Views:
    1,765
  3. brian

    Data Sets

    brian, Jan 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    551
    Hermit Dave
    Jan 14, 2004
  4. RSB
    Replies:
    2
    Views:
    488
    Peter Blum
    May 20, 2004
  5. zax75
    Replies:
    1
    Views:
    1,086
Loading...

Share This Page