Re: proposed proposal: set.values()

2006-03-31 Thread Ron Adam
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> 1. It is pure duplication that *adds* keystrokes. >> > Nobody says you shouldn't use list(s) if you know you're dealing with > a set. The idea of s.values() is so you can duck-type between dicts > and sets. You could just do the fol

Re: proposed proposal: set.values()

2006-03-31 Thread http://phr.cx
"Terry Reedy" <[EMAIL PROTECTED]> writes: > 1. It is pure duplication that *adds* keystrokes. > Nobody says you shouldn't use list(s) if you know you're dealing with a set. The idea of s.values() is so you can duck-type between dicts and sets. > 2. It copies the wrong aspect of dict. A set is l

Re: proposed proposal: set.values()

2006-03-31 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > Nobody says you shouldn't use list(s) if you know you're dealing with > > a set. The idea of s.values() is so you can duck-type between dicts > > and sets. > > if y is a dict, "x in y" looks for a matching key, not for a > matching value. Good poin

Re: proposed proposal: set.values()

2006-03-30 Thread Fredrik Lundh
Paul Rubin wrote: > > 1. It is pure duplication that *adds* keystrokes. > > Nobody says you shouldn't use list(s) if you know you're dealing with > a set. The idea of s.values() is so you can duck-type between dicts > and sets. if y is a dict, "x in y" looks for a matching key, not for a matchin

Re: proposed proposal: set.values()

2006-03-30 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > 1. It is pure duplication that *adds* keystrokes. Nobody says you shouldn't use list(s) if you know you're dealing with a set. The idea of s.values() is so you can duck-type between dicts and sets. > 2. It copies the wrong aspect of dict. A set is lik

Re: proposed proposal: set.values()

2006-03-30 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] > I'm thinking of proposing that a values method be added to set > objects, analogously with dicts. If x is a set, x.values() would be > the same as list(x). This feels logical, and it would allow unified > tr

proposed proposal: set.values()

2006-03-30 Thread Paul Rubin
I'm thinking of proposing that a values method be added to set objects, analogously with dicts. If x is a set, x.values() would be the same as list(x). This feels logical, and it would allow unified treatment of dicts and sets in some contexts. Any objections? -- http://mail.python.org/mailman/