Skip to content

Commit

Permalink
Also include 'returns' and 'raises'
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland committed Feb 12, 2024
1 parent 0b3f9b2 commit 7aae563
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ are always available. They are listed here in alphabetical order.
The local namespace (default: ``None``).
:type locals: :term:`mapping` | ``None``

:returns: The result of the evaluated expression.
:raises: Syntax errors are reported as exceptions.

The *expression* argument is parsed and evaluated as a Python expression
(technically speaking, a condition list) using the *globals* and *locals*
dictionaries as global and local namespace. If the *globals* dictionary is
Expand All @@ -553,8 +556,7 @@ are always available. They are listed here in alphabetical order.
:term:`nested scopes <nested scope>` (non-locals) in the enclosing
environment.

The return value is the result of
the evaluated expression. Syntax errors are reported as exceptions. Example:
Example:

>>> x = 1
>>> eval('x+1')
Expand Down

0 comments on commit 7aae563

Please sign in to comment.