News for hackers. Stuff that matters.
Re:Python Proposal (Inspired by Lua) by pphysch on Sunday August 27, 2023 @04:27PM (#37286334)
I don't think it's confusing or even on the level of "semantics": looping over dict keys/elements is a common pattern and the 3.7 change makes that a little more predictable and consistent.

Two dicts with same elements not being equal would be surprising and confusing.

Re:Python Proposal (Inspired by Lua) by ali_m on Sunday August 27, 2023 @06:14PM (#37287143)
If we're treating them as ordered containers then it really ought to be surprising and confusing that two dicts with the same elements in a different order are considered equal. Other ordered containers such as lists or tuples don't behave this way.

I'd use an `OrderedDict` in situations where I have a mapping where the order of elements is significant. `OrderedDict` signals intent much more clearly, and its `__eq__` method cares about order.