summaryrefslogtreecommitdiffstats
path: root/Include/compile.h
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-03-18 23:02:09 (GMT)
committerGitHub <noreply@github.com>2020-03-18 23:02:09 (GMT)
commitd112c600ab3f5e2910345bcc4bfc39439917ed87 (patch)
tree1b260548a6f6b9bebcbf9be74bcfb3f3f8a39068 /Include/compile.h
parent8849e5962ba481d5d414b3467a256aba2134b4da (diff)
downloadcpython-d112c600ab3f5e2910345bcc4bfc39439917ed87.zip
cpython-d112c600ab3f5e2910345bcc4bfc39439917ed87.tar.gz
cpython-d112c600ab3f5e2910345bcc4bfc39439917ed87.tar.bz2
bpo-39220: Do not optimise annotation if 'from __future__ import annotations' is used (GH-17866)
Do not apply AST-based optimizations if 'from __future__ import annotations' is used in order to prevent information lost in the final version of the annotations.
Diffstat (limited to 'Include/compile.h')
-rw-r--r--Include/compile.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Include/compile.h b/Include/compile.h
index 1cda955..c0c73b2 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -83,7 +83,12 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);
-PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, int optimize);
+typedef struct {
+ int optimize;
+ int ff_features;
+} _PyASTOptimizeState;
+
+PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeState *state);
#ifdef __cplusplus
}