https://hg.python.org/cpython/rev/3e8d3c4bc17e changeset: 93401:3e8d3c4bc17e branch: 2.7 parent: 93391:603bd221527c user: Georg Brandl <georg at python.org> date: Wed Nov 05 20:20:28 2014 +0100 summary: Closes #22525: clarify documentation for ast.literal_eval(). files: Doc/library/ast.rst | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -132,12 +132,14 @@ .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a Unicode or *Latin-1* encoded string - containing a Python expression. The string or node provided may only consist - of the following Python literal structures: strings, numbers, tuples, lists, - dicts, booleans, and ``None``. + containing a Python literal or container display. The string or node + provided may only consist of the following Python literal structures: + strings, numbers, tuples, lists, dicts, booleans, and ``None``. - This can be used for safely evaluating strings containing Python expressions - from untrusted sources without the need to parse the values oneself. + This can be used for safely evaluating strings containing Python values from + untrusted sources without the need to parse the values oneself. It is not + capable of evaluating arbitrarily complex expressions, for example involving + operators or indexing. .. function:: get_docstring(node, clean=True) -- Repository URL: https://hg.python.org/cpython
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4