Hi Jim, On 18 April 2014 23:46, Jim J. Jewett <jimjjewett at gmail.com> wrote: > (2) Is "the item will be hashed at least once" a language guarantee? I think that a reasonable implementation needs to hash at least once all keys that are added to the dictionary. Otherwise we end up, as you said, with a dictionary that contains non-hashable keys: this crashes when it grows and tries to convert from a list storage to a hash table. This is against the expectations and probably against the language spec... It's a bit unclear to me if the language spec requires "if [ ] in mydict:" to raise TypeError, as the key doesn't get added to the dict in this case. Similarly for "[ ] in { }" where the dictionary is empty anyway. I would say yes, erring on the side of caution... A bientôt, Armin.
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