Visitar URL original
gh-100305: Deemphasize that `ast.literal_eval` is safe in `eval` documentation by ramvikrams · Pull Request #100326 · python/cpython · GitHub
Skip to content
Merged
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
Copy Markdown
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.

@ramvikrams ramvikrams Dec 20, 2022 •

Copy link
Copy Markdown
Contributor Author

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