summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/3.9.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-03-10 16:52:34 (GMT)
committerGitHub <noreply@github.com>2020-03-10 16:52:34 (GMT)
commit13d52c268699f199a8e917a0f1dc4c51e5346c42 (patch)
treed602c97d77e3222d38c6300ed822021e51bd9dce /Doc/whatsnew/3.9.rst
parente5e56328afac50aad6d8893185d8e7ba8928afe2 (diff)
downloadcpython-13d52c268699f199a8e917a0f1dc4c51e5346c42.zip
cpython-13d52c268699f199a8e917a0f1dc4c51e5346c42.tar.gz
cpython-13d52c268699f199a8e917a0f1dc4c51e5346c42.tar.bz2
bpo-34822: Simplify AST for subscription. (GH-9605)
* Remove the slice type. * Make Slice a kind of the expr type instead of the slice type. * Replace ExtSlice(slices) with Tuple(slices, Load()). * Replace Index(value) with a value itself. All non-terminal nodes in AST for expressions are now of the expr type.
Diffstat (limited to 'Doc/whatsnew/3.9.rst')
-rw-r--r--Doc/whatsnew/3.9.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 9056289..690dbba 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -535,6 +535,12 @@ Deprecated
(Contributed by Victor Stinner in :issue:`39353`.)
+* :mod:`ast` classes ``Index`` and ``ExtSlice`` are considered deprecated
+ and will be removed in future Python versions. ``value`` itself should be
+ used instead of ``Index(value)``. ``Tuple(slices, Load())`` should be
+ used instead of ``ExtSlice(slices)``.
+ (Contributed by Serhiy Storchaka in :issue:`32892`.)
+
* The :c:func:`PyEval_InitThreads` and :c:func:`PyEval_ThreadsInitialized`
functions are now deprecated and will be removed in Python 3.11. Calling
:c:func:`PyEval_InitThreads` now does nothing. The :term:`GIL` is initialized
@@ -667,10 +673,17 @@ Changes in the Python API
since the *buffering* parameter has been removed.
(Contributed by Victor Stinner in :issue:`39357`.)
+* Simplified AST for subscription. Simple indices will be represented by
+ their value, extended slices will be represented as tuples.
+ ``Index(value)`` will return a ``value`` itself, ``ExtSlice(slices)``
+ will return ``Tuple(slices, Load())``.
+ (Contributed by Serhiy Storchaka in :issue:`34822`.)
+
* The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK`
environment variable when the :option:`-E` or :option:`-I` command line
options are being used.
+
CPython bytecode changes
------------------------