[Python-ideas] frozenset literals
Hua Lu
gotoalanlu at gmail.com
Sat Feb 2 14:33:17 CET 2013
> So, why exactly are you using ast.literal_eval() to evaluate a non-literal
> expression?
>
> Stefan
>
> PS: please reply without top-posting.
Sorry, I'm quite new to mailing lists.
I want to be able to use frozensets in ast.literal_eval portions
(especially as semantically correct keys for certain domains where
tuples have too much structure). Writing an ast filter just to
accommodate a builtin type feels way too hacky to me, and there are
legitimate reasons for having frozenset literals exist, some of which
are discussed in the link to that 2008 discussion. Also, there are
serious hacks for eval, and after seeing some of those... ay caramba.
Thanks for being patient with my newbishness.
More information about the Python-ideas
mailing list