On Sun, Jan 16, 2022 at 4:55 PM Oscar Benjamin <oscar.j.benjamin@gmail.com> wrote:
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).

di you really notunderstand my point?

I have never used the frozenset() with a literal. i.e. never had a use case for a frozenset literal.

As I mentioned in another note, I do use set displays where they *could* be frozen sets, but I dont think they've ever needed to be. And if there isn't a performance advantage, then I'm fine with that.
 
> 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.

Ah yes, I think my brain blipped because there have been multiple proposals on this list for such a thing -- but they were never realized.
 
    >>> squares = f{x**2 for x in range(10)}

Interesting idea. It feels a bit like that's realyl opening a door to a lot if proposals -- is that good or bad thing?

-CHB
--
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython