python / cpython

The Python programming language
https://www.python.org
Other
62.26k stars 29.91k forks source link

What's New in Python 3.13 (copyediting) #109975

Open AA-Turner opened 11 months ago

AA-Turner commented 11 months ago

Documentation

This is a meta-issue to capture PRs for copyedits to What's New in Python 3.13.

Other meta-issues:

Linked PRs

AA-Turner commented 11 months ago

https://docs.python.org/dev/whatsnew/3.13.html#porting-to-python-3-13

The old trashcan macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END were removed. They should be replaced by the new macros Py_TRASHCAN_BEGIN and Py_TRASHCAN_END.

This is a C API change, it should be moved to: C API Changes > Porting to Python 3.13: https://docs.python.org/dev/whatsnew/3.13.html#id5

Originally posted by @vstinner in https://github.com/python/cpython/issues/109190#issuecomment-1735270581

hugovk commented 11 months ago

Let's call out the increased share in full support from 3.13 onwards in PEP 602:

https://github.com/python/peps/commit/619e4e239383b5f59e34ebebc36278aebf599a5b

hugovk commented 10 months ago

Py_TRASHCAN_* - moved in https://github.com/python/cpython/pull/110994.

PEP 602 - added in https://github.com/python/cpython/pull/110997.

hugovk commented 4 weeks ago

When it comes to the Free-threaded CPython section, I think it can benefit from a bit of a rewrite as it was written fairly early on in development.


Right now, it only really talks about how to build your own, but since then we have it as part of the official macOS and Windows installers, so they need to be mentioned.

We have a guide in the docs for installing via Windows, so let's link to this: https://docs.python.org/3.13/using/windows.html#installing-free-threaded-binaries

But not yet for macOS, so ideally this should also be added. There's some info in https://github.com/python/cpython/issues/120098.

macOS installer screenshots ![image](https://github.com/user-attachments/assets/23e8f9d8-bda2-4cb3-9cc1-ed43b4da1281) ![image](https://github.com/user-attachments/assets/90a0f01b-89b8-4c33-a7ab-1e9429490d9b)

It also only mentions sysconfig.get_config_var("Py_GIL_DISABLED") for checking if the interpreter is configured for free-threading. We've since added the more-obvious "experimental free-threading build" to the double version flag:

❯ python3.13t --version --version
Python 3.13.0rc1 experimental free-threading build (v3.13.0rc1:e4a3e786a5e, Jul 31 2024, 19:57:27) [Clang 15.0.0 (clang-1500.3.9.4)]