summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ast.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index 8adb61f..1a94e93 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -54,10 +54,12 @@ def parse(source, filename='<unknown>', mode='exec', *,
def literal_eval(node_or_string):
"""
- Safely evaluate an expression node or a string containing a Python
+ Evaluate an expression node or a string containing only a Python
expression. The string or node provided may only consist of the following
Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
sets, booleans, and None.
+
+ Caution: A complex expression can overflow the C stack and cause a crash.
"""
if isinstance(node_or_string, str):
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')