diff options
author | Batuhan Taskaya <batuhanosmantaskaya@gmail.com> | 2020-10-04 00:46:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-04 00:46:44 (GMT) |
commit | e799aa8b92c195735f379940acd9925961ad04ec (patch) | |
tree | a0308940ce67e0535be861bfc94f3d830bba6734 /Doc/library/functions.rst | |
parent | 7f54e563dc150cd670ca8df678437455c3a7f2cd (diff) | |
download | cpython-e799aa8b92c195735f379940acd9925961ad04ec.zip cpython-e799aa8b92c195735f379940acd9925961ad04ec.tar.gz cpython-e799aa8b92c195735f379940acd9925961ad04ec.tar.bz2 |
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Also document that eval() does this (the same way).
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index c49bb0c..263c52a 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -506,6 +506,9 @@ are always available. They are listed here in alphabetical order. returns the current global and local dictionary, respectively, which may be useful to pass around for use by :func:`eval` or :func:`exec`. + If the given source is a string, then leading and trailing spaces and tabs + are stripped. + See :func:`ast.literal_eval` for a function that can safely evaluate strings with expressions containing only literals. |