diff options
author | Batuhan Taskaya <batuhanosmantaskaya@gmail.com> | 2020-10-19 01:14:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 01:14:11 (GMT) |
commit | 155938907c2b3df71608ddeaa0a43d2ec1f2c699 (patch) | |
tree | c99107df59f6b357597805ead1d9928514e44103 /Doc/library/ast.rst | |
parent | 3c0ac18504cfeed822439024339d5717f42bdd66 (diff) | |
download | cpython-155938907c2b3df71608ddeaa0a43d2ec1f2c699.zip cpython-155938907c2b3df71608ddeaa0a43d2ec1f2c699.tar.gz cpython-155938907c2b3df71608ddeaa0a43d2ec1f2c699.tar.bz2 |
bpo-40484: Document compiler flags under AST module (GH-19885)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Doc/library/ast.rst')
-rw-r--r-- | Doc/library/ast.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 62138ef..f95ee1d 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -1756,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 |