On Mon, 17 Jan 2022 at 00:46, Christopher Barker <[email protected]>
wrote:
> I’m a bit confused — would adding a “literal” form for frozenset provide
> much, if any, of an optimization? If not,
> that means it’s only worth doing for convenience.
>
> How often do folks need a frozen set literal? I don’t think I’ve ever used
> one.
>
You won't have used one because they have not yet existed (hence this
thread).
> If we did, then f{‘this’: ‘that’} should make a frozen dict, yes?
>
A frozen dict would also be useful but the implementation doesn't exist. If
it did exist then in combination with this proposal that syntax for frozen
dicts would be an obvious extension.
A more relevant question right now is if any other set syntax should apply
to frozensets e.g. should this work:
>>> squares = f{x**2 for x in range(10)}
--
Oscar
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/SCHOMJYEZYTAEZYYU2YV3J4VXUL36WNY/
Code of Conduct: http://python.org/psf/codeofconduct/