diff options
author | Georg Brandl <georg@python.org> | 2010-07-11 09:41:21 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-07-11 09:41:21 (GMT) |
commit | 492f3fc272a3b3e941f0911a1ef722065c58452e (patch) | |
tree | ef0c03388315f50c310fc87766fec3aee337c64e /Lib/ast.py | |
parent | e40ee509e35edd7dcab4009c4a65efc626527bb8 (diff) | |
download | cpython-492f3fc272a3b3e941f0911a1ef722065c58452e.zip cpython-492f3fc272a3b3e941f0911a1ef722065c58452e.tar.gz cpython-492f3fc272a3b3e941f0911a1ef722065c58452e.tar.bz2 |
Allow set literals in literal_eval().
Diffstat (limited to 'Lib/ast.py')
-rw-r--r-- | Lib/ast.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -58,6 +58,8 @@ def literal_eval(node_or_string): 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)) |