Ka-Ping Yee, on sets: I think you forgot one behavior: >>> t.append('Spam!') >>> t.append('Spam!') KeyError: set already contains value 'Spam!' no? FWIW, I don't like the use of the word 'append', which to me implies a serial order. I'd use 'add', but that's a nit. > 2. How do sets sort? [..] > a. The answer is the same as whatever answer we get when > Python supports rich comparisons and instances can have > partial orderings too. [..] > (Side note: Do we achieve a. just by divorcing __cmp__ from > >, >=, etc.? I think we hashed (pun!) all of this out a couple of years ago in one of your hibernation periods =). I'll try to find the deja thread on the topic. > ((Side side side note: in E, Mark Miller also ran into the > problem of spelling different kinds of "equals"es. For > object identity we have "is", for content comparison we > have "==". If we need a new operator for magnitude equality > i suggest "<=>", as used in E.)) Isn't magnitude equality currently spelled len(a) == len(b)? > Well, it may be a lot of words, but it's not much good unless you > are going to use it in practice. I think i would have good use for > it, but i would like to hear your opinions. Would you use such a > thing? I use some of the features of such a thing now by making up dictionaries with None as values for all the keys. I have no strong feeling re: whether we need a new datatype for sets. -david ascher
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4