8000 gh-102856: Add changes related to PEP 701 in 3.12 What's New docs by mgmacias95 · Pull Request #104824 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

gh-102856: Add changes related to PEP 701 in 3.12 What's New docs #104824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make some minor aditions to the tokenize changes
  • Loading branch information
pablogsal committed May 24, 2023
commit 08036e526081fa8fcd9ee537b61a75a82986b6a9
18 changes: 14 additions & 4 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ tokenize

* The :mod:`tokenize` module includes the changes introduced in :pep:`701`. (
Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.)
See :ref:`whatsnew312-porting-to-python312` for more information on the
changes to the :mod:`tokenize` module.

types
-----
Expand Down Expand Up @@ -1207,6 +1209,8 @@ Removed
Iceape, Firebird, and Firefox versions 35 and below (:gh:`102871`).


.. _whatsnew312-porting-to-python312:

Porting to Python 3.12
======================

Expand Down Expand Up @@ -1301,10 +1305,16 @@ Changes in the Python API
1,13-1,17: FSTRING_MIDDLE ' end'
1,17-1,18: FSTRING_END '"'

Aditionally, final ``DEDENT`` tokens are now emitted within the bounds of the
input. This means that for a file containing 3 lines, the old version of the
tokenizer returned a ``DEDENT`` token in line 4 whilst the new version returns
the token in line 3.
Aditionally, there may be some minor behavioral changes as a consecuence of the
changes required to support :pep:`701`. Some of these changes include:

* Some final ``DEDENT`` tokens are now emitted within the bounds of the
input. This means that for a file containing 3 lines, the old version of the
tokenizer returned a ``DEDENT`` token in line 4 whilst the new version returns
the token in line 3.

* The ``type`` attribute of the tokens emitted when tokenizing some invalid Python
characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``.

Build Changes
=============
Expand Down
0