Skip to content
Merged
Changes from 6 commits
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
13 changes: 9 additions & 4 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,9 @@ are always available. They are listed here in alphabetical order.
untrusted user-supplied input will lead to security vulnerabilities.

The *source* argument is parsed and evaluated as a Python expression
(technically speaking, a condition list) using the *globals* and *locals*
mappings as global and local namespace. If the *globals* dictionary is
present and does not contain a value for the key ``__builtins__``, a
(technically speaking, an :ref:`expression list <exprlists>`) , using
the *globals* and *locals* mappings as global and local namespace. If the *globals*
dictionary is present and does not contain a value for the key ``__builtins__``, a
reference to the dictionary of the built-in module :mod:`builtins` is
inserted under that key before *source* is parsed.
Overriding ``__builtins__`` can be used to restrict or change the available
Expand All @@ -633,6 +633,9 @@ are always available. They are listed here in alphabetical order.
>>> eval('x+1')
2

>>> eval("1, 2")
(1,2)
Comment thread
palakkhinvasara marked this conversation as resolved.
Resolved

This function can also be used to execute arbitrary code objects (such as
those created by :func:`compile`). In this case, pass a code object instead
of a string. If the code object has been compiled with ``'exec'`` as the
Expand Down Expand Up @@ -2380,4 +2383,6 @@ are always available. They are listed here in alphabetical order.

.. [#] Note that the parser only accepts the Unix-style end of line convention.
If you are reading the code from a file, make sure to use newline conversion
mode to convert Windows or Mac-style newlines.
mode to convert Windows or Mac-style newlines.ECHO is on.

ECHO is on.
Comment thread
palakkhinvasara marked this conversation as resolved.
Resolved
Loading