Is it possible to create frozen sets with curly braces?

429 Views Asked by At

It appears that one can only create a frozenset using the frozenset() constructor.

Is this true or is there a textual way to create a frozen set? I can find no evidence one way or the other in the docs.

1

There are 1 best solutions below

0
Ofer Sadan On BEST ANSWER

One sentence above what you linked is the answer (emphasis mine):

Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: {'jack', 'sjoerd'}, in addition to the set constructor.

So in short, no, there is no way to do that