commit | 492f3fc272a3b3e941f0911a1ef722065c58452e | [log] [tgz] |
---|---|---|
author | Georg Brandl <georg@python.org> | Sun Jul 11 09:41:21 2010 +0000 |
committer | Georg Brandl <georg@python.org> | Sun Jul 11 09:41:21 2010 +0000 |
tree | ef0c03388315f50c310fc87766fec3aee337c64e | |
parent | e40ee509e35edd7dcab4009c4a65efc626527bb8 [diff] |
Allow set literals in literal_eval().
diff --git a/Lib/ast.py b/Lib/ast.py index 0b8baf7..092f077 100644 --- a/Lib/ast.py +++ b/Lib/ast.py
@@ -58,6 +58,8 @@ return tuple(map(_convert, node.elts)) elif isinstance(node, List): return list(map(_convert, node.elts)) + elif isinstance(node, Set): + return set(map(_convert, node.elts)) elif isinstance(node, Dict): return dict((_convert(k), _convert(v)) for k, v in zip(node.keys, node.values))