Re: Revisiting a frozenset display literal

Jan. 19, 2022
5:36 a.m.
On Wed, Jan 19, 2022 at 02:20:06PM +0100, Marco Sulla wrote:
YAGNI. If you want a frozen list, you can already write that as a tuple. There is no need to do: [1, 2, 3].frozen() when you can just write `(1, 2, 3)`. Same for bytearray and bytes. We already have display or literal syntax for frozen lists and frozen bytearrays. It is only frozensets which don't, and since people cannot agree on syntax for a frozenset display, we're stuck with approaching it side-ways: a method call which, if applied to a set display of literals, could be safely optimized out by the compiler. The rest of the time, someset.frozen() would just call frozenset. -- Steve
1155
Age (days ago)
1155
Last active (days ago)
0 comments
1 participants
participants (1)
-
Steven D'Aprano