Perhaps, but we'd have to be careful with how we introduce those symbols:
http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html
You could possibly not allow attribute access but permit those
symbols... is there an exploit possible with that much filtering?
On Sat, Feb 2, 2013 at 12:30 PM, MRAB
On 2013-02-02 14:28, Antoine Pitrou wrote:
On Sun, 03 Feb 2013 01:20:38 +1100 Steven D'Aprano
wrote: Unfortunately the proposal to use f{ ... } for frozen sets cannot work within the constraints of Python's lexer:
http://mail.python.org/pipermail/python-3000/2008-January/011838.html
Unfortunately we're running out of useful, easy to enter symbols for literals. Until such time (Python4000 perhaps, or more likely Python5000) as we can use a rich set of Unicode literals, I don't think there is any clear way to have a frozenset literal.
I'm not sure what the point is. frozensets are too rarely used to deserve a literal notation.
Does it need a special notation as such?
Wouldn't an alternative be to support "frozenset(...)" where "..." is parseable by ast.literal_eval()?
The same thing could be done with some other built-in classes.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas