25 Jul
2019
25 Jul
'19
2:13 p.m.
David Mertz wrote:
This feels similar to NumPy arrays, that also will not compare for equality in bare form.
Not quite the same -- comparing numpy arrays doesn't raise an exception, it returns an array of booleans. What raises an exception is trying to use the resulting array in a boolean context. But it is an example of something raising an exception that one would normally expect to always succeed. In the case of dict.values() == dict.values(), raising an exception is probably the least bad thing. Yes, it can lead to code blowing up unexpectedly, but I think it's better than having code appear to work while doing something subtly different from what you wanted. -- Greg