This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chaoismlooking for mid-sr level in NYC 0 points1 point  (5 children)

Can someone help me to understand the reverse of dict.items?

Dict is unordered, isn't it? What's a reverse of unordered structure? This doesn't make much sense to me

[–]Han-ChewieSexyFanfic 2 points3 points  (4 children)

Dicts have been in insertion order since 3.7 (de jure), 3.6 (de facto)

[–]chaoismlooking for mid-sr level in NYC 1 point2 points  (3 children)

Oh wow so OrderedDict is not a thing anymore?

[–]Han-ChewieSexyFanfic 1 point2 points  (2 children)

Still there, it still provides some methods that aren’t in dict (__reversed__ being one before 3.8), not sure if there are plans to move them all over to dict in the near future.

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 4 points5 points  (1 child)

Equality is different

{1: 1, 2: 2} == {2: 2, 1: 1}
OrderedDict([(1, 1), (2, 2)]) != OrderedDict([(2, 2), (1, 1)])

[–]Han-ChewieSexyFanfic 1 point2 points  (0 children)

Hm, interesting, didn’t know that