Skip to content
Merged
Changes from all 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
7 changes: 7 additions & 0 deletions Doc/builtins/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ are always available. They are listed here in alphabetical order.
consists of a single expression, or ``'single'`` if it consists of a single
interactive statement (in the latter case, expression statements that
evaluate to something other than ``None`` will be printed).
It can also be ``'func_type'`` if *source* consists of a
function type signature, for example ``(int) -> str``; see
:func:`ast.parse` for more information. This mode requires passing
:data:`ast.PyCF_ONLY_AST` in *flags*.

The optional arguments *flags* and *dont_inherit* control which
:ref:`compiler options <ast-compiler-flags>` should be activated
Expand Down Expand Up @@ -387,6 +391,9 @@ are always available. They are listed here in alphabetical order.
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable
support for top-level ``await``, ``async for``, and ``async with``.

.. versionchanged:: 3.8
Added support for ``mode='func_type'``.

.. versionchanged:: 3.12
:exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes
are encountered in *source*.
Expand Down
Loading