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
>>> eval('x+1')
2
+ >>> eval("1, 2")
+ (1, 2)
+
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