<p dir="ltr"><br>
On 3 Feb 2013 00:39, "Antoine Pitrou" <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br>
><br>
> On Sun, 3 Feb 2013 00:28:55 +1000<br>
> Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
> > FWIW, I could personally tolerate the introduction of s{} and fs{}<br>
> > literals. We'd just declare the "s" prefix optional for non-empty sets to<br>
> > match the current rules.<br>
> ><br>
> > Encouraging the use of ast.literal_eval() over the security nightmare that<br>
> > is eval() would be more than enough justification for me. (As a syntax<br>
> > change, the idea would still need a PEP, though)<br>
><br>
> If it is enough of a justification, then why not literal support for<br>
> more useful datatypes (decimal, datetime...) rather than frozenset?</p>
<p dir="ltr">The difference is that decimal and datetime already have safe "from string" conversion operations. The empty set and frozen sets do not.</p>
<p dir="ltr">That said, a decimal literal proposal would be a reasonable follow-up to the incorporation of cdecimal.</p>
<p dir="ltr">Datetime is a more difficult prospect, since there are good reasons strptime is as flexible as it is.</p>
<p dir="ltr">Regardless, I'm not saying a PEP to support all the builtin container types in ast.literal_eval would necessarily be accepted. I'm merely saying it is *worth writing*.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Regards<br>
><br>
> Antoine.<br>
><br>
><br>
> _______________________________________________<br>
> Python-ideas mailing list<br>
> <a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-ideas">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</p>