Not a huge fan of an f-prefix for a frozen set (I prefer just recognizing
the case and optimizing the byte code, I don't think frozensets are used
often enough to justify its own syntax), but I love {,} for an empty set.On Tue, Jan 18, 2022 at 4:13 PM Rob Cliffe via Python-ideas < [email protected]> wrote: > > > On 18/01/2022 19:42, MRAB wrote: > > On 2022-01-18 18:54, Neil Girdhar wrote: > >> Even if f{1} creates a frozenset, I don't think f{} should create a > >> frozenset. I think it makes more sense to keep f{1: 2} open for > >> frozendict if it ever makes it in. Also, {} should be consisten with > >> f{} (both should create dicts). If you want an empty frozenset, you > >> would have to do it the same way you do it for sets: either > >> frozenset() or f{*()}. > >> > > [snip] > > An alternative might be to allow {,} for an empty set, which would > > then let you have f{,} for an empty frozenset. > I like it! > Rob Cliffe > _______________________________________________ > 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/HXJXYO5A7CO6HZHBQEFYS5Q7IHKSY7Y3/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- -Dr. Jon Crall (him)
_______________________________________________ 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/JMTIQSP6IKXZWZSWWWJME2HLPASJVMXM/ Code of Conduct: http://python.org/psf/codeofconduct/
