summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
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 /Doc/whatsnew
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 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.13.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 47b868b..bfab868 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -85,6 +85,12 @@ Other Language Changes
This change will affect tools using docstrings, like :mod:`doctest`.
(Contributed by Inada Naoki in :gh:`81283`.)
+* 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.
+ (Contributed by Irit Katriel in :gh:`108113`).
+
New Modules
===========
@@ -94,6 +100,14 @@ New Modules
Improved Modules
================
+ast
+---
+
+* :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``.
+ (Contributed by Irit Katriel in :gh:`108113`).
+
array
-----