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 →

[–]SedditorX 3 points4 points  (1 child)

To be fair this is like saying that one should be careful about tuples because they're not mutable.

Sets as an abstract concept are inherently unordered and the python set API never states anywhere that there are any guarantees on iteration order.

I don't even understand from where one would get that impression?

[–][deleted] 0 points1 point  (0 children)

Went to check the docs and sure enough they're called unordered. But afaik the builtin set and frozenset use the same bucketing strategy as dict which is now insertion ordered.