[Michael Chermside] > Is the behavior of count_elements() exactly the same as > the given python equivalent when one (or more) of the > elements in the iterable is not hashable? [Raymond Hettinger] > That was the original idea; however, we could easily keep a separate > list of identity comparisons for unhashables If you do indeed handle unhashables, then I think this interface seems useful, although I'd order it (elem, cnt) so that when everything IS hashable a dict can be built via dict(*count_elements(iterable)) If you do NOT handle unhashables, then I'd agree with Bob that we should just return the dict itself -- that's the most natural data structure for expressing a bunch of counts available in Python. And I think the function is worth including. -- Michael Chermside This email may contain confidential or privileged information. If you believe you have received the message in error, please notify the sender and delete the message without copying or disclosing it.
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