[Python-ideas] frozenset literals

Hua Lu gotoalanlu at gmail.com
Sat Feb 2 07:24:34 CET 2013


This is similar to another proposal:
http://mail.python.org/pipermail/python-3000/2008-January/011798.html

Anyway, I was using ast.literal_eval and attempted to use frozenset({...})
as a key in a dictionary, which failed, because frozenset isn't a literal
(though putting frozenset in the environment would be a security risk). I
am currently working around this with tuples, but I'd like a literal for
representing frozensets as well. I also use frozensets elsewhere in the
code in ways similar to Raymond's original suggestion.

Perhaps something like f{...} for declaring frozenset( comprehension)?
literals?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130202/7ac1273f/attachment.html>


More information about the Python-ideas mailing list