Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-100305: Deemphasize thatast.literal_eval
is safe ineval
documentation#100326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Doc/library/functions.rst Outdated
@@ -554,8 +554,9 @@ are always available. They are listed here in alphabetical order. | |||
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. | |||
.. versionchanged:: 3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not so sure about saying 'version changed', as it seems to imply that only 3.11 has the change, but 3.10 also has it as it was backported (see PR). I'd say it's okay to just keep the original format and adjust the wording.
ramvikramsDec 20, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
done
ast.literal_eval
is still referred to as safe by the documentation foreval
ast.literal_eval
is safe ineval
documentation
gh-100305: Changed the doc referencing to
literal_eval
in eval as it was misleading asliteral_eval
was said safe