Skip to content

gh-100305: Deemphasize that ast.literal_eval is safe in eval 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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update functions.rst
  • Loading branch information
ramvikrams committed Dec 18, 2022
commit da1f41689e795c030a865225df61cde27e87e3cc
5 changes: 2 additions & 3 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,8 @@ are always available. They are listed here in alphabetical order.
are stripped.

.. versionchanged:: 3.11
Copy link
Contributor

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.

Copy link
Contributor Author

@ramvikrams ramvikrams Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

:func:`ast.literal_eval` is no longer marked as safe for evaluating strings
with expressions containing only literals. For further information, please
check the documentation for :func:`ast.literal_eval`
See :func:`ast.literal_eval` for a function that can "safely" evaluate strings
with expressions containing only literals.

.. audit-event:: exec code_object eval

Expand Down