diff options
Diffstat (limited to 'Doc/library/ast.rst')
-rw-r--r-- | Doc/library/ast.rst | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 755c60fba6..f95ee1d5c6 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -1586,6 +1586,9 @@ and classes for traversing abstract syntax trees: .. versionchanged:: 3.9 Now supports creating empty sets with ``'set()'``. + .. versionchanged:: 3.10 + For string inputs, leading spaces and tabs are now stripped. + .. function:: get_docstring(node, clean=True) @@ -1753,6 +1756,34 @@ and classes for traversing abstract syntax trees: Added the *indent* option. +.. _ast-compiler-flags: + +Compiler Flags +-------------- + +The following flags may be passed to :func:`compile` in order to change +effects on the compilation of a program: + +.. data:: PyCF_ALLOW_TOP_LEVEL_AWAIT + + Enables support for top-level ``await``, ``async for``, ``async with`` + and async comprehensions. + + .. versionadded:: 3.8 + +.. data:: PyCF_ONLY_AST + + Generates and returns an abstract syntax tree instead of returning a + compiled code object. + +.. data:: PyCF_TYPE_COMMENTS + + Enables support for :pep:`484` and :pep:`526` style type comments + (``# type: <type>``, ``# type: ignore <stuff>``). + + .. versionadded:: 3.8 + + .. _ast-cli: Command-Line Usage @@ -1820,4 +1851,4 @@ to stdout. Otherwise, the content is read from stdin. `Parso <https://parso.readthedocs.io>`_ is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python versions). Parso is also able to list multiple syntax errors - in your python file.
\ No newline at end of file + in your python file. |