[$] An ordered set for Python?

Post Syndicated from original https://lwn.net/Articles/912353/

Python has lots of different options for mutable data structures, both
directly in
the language and in the standard library. Lists, dictionaries (or “dicts”), and
sets are the foundation, but two of those maintain an order based on how
the elements are added, while sets do not. A recent discussion on the Python Discourse forum raised the
idea of adding an ordered variant of sets; while it does not look like
there is a big push to add the feature, the discussion did show some of
what is generally needed to get new things into the language—and could well
lead to its inclusion.