diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst index 88717a35745204..0681442a755c9f 100644 --- a/Doc/builtins/functions.rst +++ b/Doc/builtins/functions.rst @@ -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 ` should be activated @@ -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*.