Dictionaries should have key-based set operations

But we MUST match by something, and it would be nightmarishly confusing to use something other than either identtiy or equality. Identity’s out (there’s no way we’d want string keys to fail to match just because they’re the wrong object - yes, there are a few specific situations where you want an identity dict, but for the most part, no), and a “type and value equality” concept like you’re suggesting is its own bizarreness. Introducing a new type of equality, this “strict equality”, only brings in new problems - just ask JavaScript programmers.

1 Like