On Sun, 3 Feb 2013 00:56:57 +1000 Nick Coghlan <ncoghlan@gmail.com> wrote:
On 3 Feb 2013 00:39, "Antoine Pitrou" <solipsis@pitrou.net> wrote:
On Sun, 3 Feb 2013 00:28:55 +1000 Nick Coghlan <ncoghlan@gmail.com> wrote:
FWIW, I could personally tolerate the introduction of s{} and fs{} literals. We'd just declare the "s" prefix optional for non-empty sets
match the current rules.
Encouraging the use of ast.literal_eval() over the security nightmare
to that
is eval() would be more than enough justification for me. (As a syntax change, the idea would still need a PEP, though)
If it is enough of a justification, then why not literal support for more useful datatypes (decimal, datetime...) rather than frozenset?
The difference is that decimal and datetime already have safe "from string" conversion operations. The empty set and frozen sets do not.
You can call set() or frozenset() on a tuple literal, if you know you want to end up with a set of frozenset. Regards Antoine.