3 ms·
One issue with that is that dicts can hold any hashable object, not just strings. To get a comparable binary representation for arbitrary types, you need to us
by tveita 13y ago
One issue with that is that dicts can hold any hashable object, not just strings.
To get a comparable binary representation for arbitrary types, you need to use the hash method. So now you get the worst of both worlds - a hash call, and a tree lookup, and you need buckets for collisions.
You can't special case strings either - non-string objects can be equal to strings.