[$] Python sets, frozensets, and literals

Post Syndicated from original https://lwn.net/Articles/881599/rss

A Python “frozenset” is simply a set
object
that is immutable—the objects it contains are determined at
initialization time and cannot be changed thereafter. Like sets, frozensets are
built into the language, but unlike most of the other standard Python
types, there is no way to create a literal frozenset object. Changing that,
by providing a mechanism to do so, was the topic
of a recent discussion on the python-ideas mailing list.