summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-08-21 16:31:30 (GMT)
committerGitHub <noreply@github.com>2023-08-21 16:31:30 (GMT)
commit10a91d7e98d847b05292eab828ff9ae51308d3ee (patch)
treea81f95a971c03710f13217cf89e0f12532341af8 /Misc
parent47022a079eb9d2a2af781abae3de4a71f80247c2 (diff)
downloadcpython-10a91d7e98d847b05292eab828ff9ae51308d3ee.zip
cpython-10a91d7e98d847b05292eab828ff9ae51308d3ee.tar.gz
cpython-10a91d7e98d847b05292eab828ff9ae51308d3ee.tar.bz2
gh-108113: Make it possible to create an optimized AST (#108154)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2023-08-18-18-21-27.gh-issue-108113.1h0poE.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-08-18-18-21-27.gh-issue-108113.1h0poE.rst b/Misc/NEWS.d/next/Core and Builtins/2023-08-18-18-21-27.gh-issue-108113.1h0poE.rst
new file mode 100644
index 0000000..6668057
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2023-08-18-18-21-27.gh-issue-108113.1h0poE.rst
@@ -0,0 +1,8 @@
+The :func:`compile` built-in can now accept a new flag,
+``ast.PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST``
+except that the returned ``AST`` is optimized according to the value
+of the ``optimize`` argument.
+
+:func:`ast.parse` now accepts an optional argument ``optimize``
+which is passed on to the :func:`compile` built-in. This makes it
+possible to obtain an optimized ``AST``.