<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Sick Gaming - Python]]></title>
		<link>https://sickgaming.net/</link>
		<description><![CDATA[Sick Gaming - https://sickgaming.net]]></description>
		<pubDate>Sun, 01 Nov 2026 03:21:26 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[Py Blog] Python 3.15.2, 3.14.10, 3.13.18, 3.12.16 and 3.11.18 are out]]></title>
			<link>https://sickgaming.net/thread-114200.html</link>
			<pubDate>Sun, 25 Oct 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-114200.html</guid>
			<description><![CDATA[Here are expedited security releases of Python 3.15, 3.14, 3.13, 3.12 and 3.11.<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-3152/" target="_blank" rel="noopener" class="mycode_url">Python 3.15.2</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31410/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.10</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31318/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.18</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31216/" target="_blank" rel="noopener" class="mycode_url">Python 3.12.16</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31118/" target="_blank" rel="noopener" class="mycode_url">Python 3.11.18</a><br />
<br />
</li>
</ul>
<br />
They address <a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" target="_blank" rel="noopener" class="mycode_url">the compromised eMudhra intermediate CA keys</a>.<br />
These keys are now blocked by the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ssl</code></div></div> module as a last resort against their use.<br />
Normal uses of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div>, including to upgrade <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div> itself, are now safe from attacks based on those compromised keys, even if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div> hasn’t been updated yet.<br />
<br />
Python 3.15.2 and 3.14.10 come with binary installers.<br />
Python 3.13.18, 3.12.16 and 3.11.18 are source-only security releases.<br />
<br />
Security content in all five releases<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-115557" target="_blank" rel="noopener" class="mycode_url">CVE-2026-115557</a> — <a href="https://github.com/python/cpython/issues/160040" target="_blank" rel="noopener" class="mycode_url">gh-160040</a>: Distrust compromised eMudhra intermediate CA keys<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-114583" target="_blank" rel="noopener" class="mycode_url">CVE-2026-114583</a> — <a href="https://github.com/python/cpython/issues/160097" target="_blank" rel="noopener" class="mycode_url">gh-160097</a>: Reject links replacing the destination in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tarfile.tar_filter</code></div></div><br />
</li>
<li><a href="https://github.com/python/cpython/issues/160300" target="_blank" rel="noopener" class="mycode_url">gh-160300</a>: Reject cookies with a negative version in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>http.cookiejar</code></div></div><br />
</li>
</ul>
<br />
Additional security content by version<br />
<br />
Python 3.13.18, 3.12.16 and 3.11.18<br />
<br />
These fixes were already included in Python 3.15.1 and 3.14.9.<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-77214" target="_blank" rel="noopener" class="mycode_url">CVE-2026-77214</a> and <a href="https://www.cve.org/CVERecord?id=CVE-2026-102633" target="_blank" rel="noopener" class="mycode_url">CVE-2026-102633</a> — <a href="https://github.com/python/cpython/issues/158876" target="_blank" rel="noopener" class="mycode_url">gh-158876</a>: Update bundled Expat to 2.9.0<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2024-3220" target="_blank" rel="noopener" class="mycode_url">CVE-2024-3220</a> — <a href="https://github.com/python/cpython/issues/159428" target="_blank" rel="noopener" class="mycode_url">gh-159428</a>: Don’t read <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>mimetypes.knownfiles</code></div></div> by default on Windows<br />
<br />
</li>
<li><a href="https://github.com/python/cpython/issues/87720" target="_blank" rel="noopener" class="mycode_url">gh-87720</a>: Fix additional header refolding-quoting edge case<br />
<br />
</li>
</ul>
<br />
Python 3.13.18 and 3.12.16<br />
<br />
This fix was already included in Python 3.15.0 and 3.14.9.<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/157579" target="_blank" rel="noopener" class="mycode_url">gh-157579</a>: Fix race condition in the cleanup of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tempfile.TemporaryDirectory</code></div></div><br />
</li>
</ul>
<br />
For the full details, see the <a href="https://docs.python.org/release/3.15.2/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.15.2 changelog</a>, <a href="https://docs.python.org/release/3.14.10/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.14.10 changelog</a>, <a href="https://docs.python.org/release/3.13.18/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.13.18 changelog</a>, <a href="https://docs.python.org/release/3.12.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.12.16 changelog</a> and <a href="https://docs.python.org/release/3.11.18/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.11.18 changelog</a>.<br />
<br />
Stay safe and upgrade!<br />
<br />
As always, upgrading is highly recommended to all users of affected versions.<br />
<br />
Enjoy the new releases<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your certified release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Thomas Wouters<br />
<br />
Pablo Galindo Salgado<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></description>
			<content:encoded><![CDATA[Here are expedited security releases of Python 3.15, 3.14, 3.13, 3.12 and 3.11.<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-3152/" target="_blank" rel="noopener" class="mycode_url">Python 3.15.2</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31410/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.10</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31318/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.18</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31216/" target="_blank" rel="noopener" class="mycode_url">Python 3.12.16</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31118/" target="_blank" rel="noopener" class="mycode_url">Python 3.11.18</a><br />
<br />
</li>
</ul>
<br />
They address <a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" target="_blank" rel="noopener" class="mycode_url">the compromised eMudhra intermediate CA keys</a>.<br />
These keys are now blocked by the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ssl</code></div></div> module as a last resort against their use.<br />
Normal uses of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div>, including to upgrade <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div> itself, are now safe from attacks based on those compromised keys, even if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip</code></div></div> hasn’t been updated yet.<br />
<br />
Python 3.15.2 and 3.14.10 come with binary installers.<br />
Python 3.13.18, 3.12.16 and 3.11.18 are source-only security releases.<br />
<br />
Security content in all five releases<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-115557" target="_blank" rel="noopener" class="mycode_url">CVE-2026-115557</a> — <a href="https://github.com/python/cpython/issues/160040" target="_blank" rel="noopener" class="mycode_url">gh-160040</a>: Distrust compromised eMudhra intermediate CA keys<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-114583" target="_blank" rel="noopener" class="mycode_url">CVE-2026-114583</a> — <a href="https://github.com/python/cpython/issues/160097" target="_blank" rel="noopener" class="mycode_url">gh-160097</a>: Reject links replacing the destination in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tarfile.tar_filter</code></div></div><br />
</li>
<li><a href="https://github.com/python/cpython/issues/160300" target="_blank" rel="noopener" class="mycode_url">gh-160300</a>: Reject cookies with a negative version in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>http.cookiejar</code></div></div><br />
</li>
</ul>
<br />
Additional security content by version<br />
<br />
Python 3.13.18, 3.12.16 and 3.11.18<br />
<br />
These fixes were already included in Python 3.15.1 and 3.14.9.<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-77214" target="_blank" rel="noopener" class="mycode_url">CVE-2026-77214</a> and <a href="https://www.cve.org/CVERecord?id=CVE-2026-102633" target="_blank" rel="noopener" class="mycode_url">CVE-2026-102633</a> — <a href="https://github.com/python/cpython/issues/158876" target="_blank" rel="noopener" class="mycode_url">gh-158876</a>: Update bundled Expat to 2.9.0<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2024-3220" target="_blank" rel="noopener" class="mycode_url">CVE-2024-3220</a> — <a href="https://github.com/python/cpython/issues/159428" target="_blank" rel="noopener" class="mycode_url">gh-159428</a>: Don’t read <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>mimetypes.knownfiles</code></div></div> by default on Windows<br />
<br />
</li>
<li><a href="https://github.com/python/cpython/issues/87720" target="_blank" rel="noopener" class="mycode_url">gh-87720</a>: Fix additional header refolding-quoting edge case<br />
<br />
</li>
</ul>
<br />
Python 3.13.18 and 3.12.16<br />
<br />
This fix was already included in Python 3.15.0 and 3.14.9.<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/157579" target="_blank" rel="noopener" class="mycode_url">gh-157579</a>: Fix race condition in the cleanup of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tempfile.TemporaryDirectory</code></div></div><br />
</li>
</ul>
<br />
For the full details, see the <a href="https://docs.python.org/release/3.15.2/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.15.2 changelog</a>, <a href="https://docs.python.org/release/3.14.10/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.14.10 changelog</a>, <a href="https://docs.python.org/release/3.13.18/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.13.18 changelog</a>, <a href="https://docs.python.org/release/3.12.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.12.16 changelog</a> and <a href="https://docs.python.org/release/3.11.18/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.11.18 changelog</a>.<br />
<br />
Stay safe and upgrade!<br />
<br />
As always, upgrading is highly recommended to all users of affected versions.<br />
<br />
Enjoy the new releases<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your certified release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Thomas Wouters<br />
<br />
Pablo Galindo Salgado<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python 3.15.1, 3.14.9 and 3.13.17 are out]]></title>
			<link>https://sickgaming.net/thread-114083.html</link>
			<pubDate>Tue, 20 Oct 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-114083.html</guid>
			<description><![CDATA[Here are expedited security releases of Python 3.15 and 3.14, and a special security release of 3.13.<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-3151/" target="_blank" rel="noopener" class="mycode_url">Python 3.15.1</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-3149/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.9</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31317/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.17</a><br />
<br />
</li>
</ul>
<br />
They all upgrade the bundled pip to version 26.2.2,<br />
which includes certifi 2026.10.19 to address the <a href="https://emudhra.we-have-a-problem.com/" target="_blank" rel="noopener" class="mycode_url">eMudhra / emSign CA certificate security incident</a>.<br />
<br />
We don’t normally update pip for security releases like Python 3.13 because of backward compatibility concerns, but since 3.13 only just entered security-only mode, doing a special release with <span style="font-style: italic;" class="mycode_i">installers</span> seemed prudent.<br />
<br />
See the <a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" target="_blank" rel="noopener" class="mycode_url">Discourse announcement</a> for more information.<br />
<br />
For all existing virtual environments on your system, please upgrade pip and uv to the latest versions.<br />
<br />
To upgrade pip securely within a virtualenv:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>python -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
If you cannot immediately upgrade to this release, you can upgrade certificates for a Python 3.15 macOS installation and pip itself via:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.15/bin/python3.15t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
For 3.14:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.14/bin/python3.14t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
For 3.13:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.13/bin/python3.13t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div><br />
Additionally, the macOS installer for this release is built with a pre-release of Tk, fixing <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">a possible hang on macOS 27.0</a> in applications using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div>, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div>, in older releases.<br />
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your certified release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Thomas Wouters<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></description>
			<content:encoded><![CDATA[Here are expedited security releases of Python 3.15 and 3.14, and a special security release of 3.13.<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-3151/" target="_blank" rel="noopener" class="mycode_url">Python 3.15.1</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-3149/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.9</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31317/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.17</a><br />
<br />
</li>
</ul>
<br />
They all upgrade the bundled pip to version 26.2.2,<br />
which includes certifi 2026.10.19 to address the <a href="https://emudhra.we-have-a-problem.com/" target="_blank" rel="noopener" class="mycode_url">eMudhra / emSign CA certificate security incident</a>.<br />
<br />
We don’t normally update pip for security releases like Python 3.13 because of backward compatibility concerns, but since 3.13 only just entered security-only mode, doing a special release with <span style="font-style: italic;" class="mycode_i">installers</span> seemed prudent.<br />
<br />
See the <a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" target="_blank" rel="noopener" class="mycode_url">Discourse announcement</a> for more information.<br />
<br />
For all existing virtual environments on your system, please upgrade pip and uv to the latest versions.<br />
<br />
To upgrade pip securely within a virtualenv:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>python -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
If you cannot immediately upgrade to this release, you can upgrade certificates for a Python 3.15 macOS installation and pip itself via:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.15/bin/python3.15t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
For 3.14:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.14/bin/python3.14t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
For 3.13:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13 -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13 -m pip install --upgrade certifi
/Library/Frameworks/PythonT.framework/Versions/3.13/bin/python3.13t -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"</code></div></div><br />
macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div><br />
Additionally, the macOS installer for this release is built with a pre-release of Tk, fixing <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">a possible hang on macOS 27.0</a> in applications using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div>, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div>, in older releases.<br />
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your certified release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Thomas Wouters<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python 3.16.0 alpha 1 is now available]]></title>
			<link>https://sickgaming.net/thread-113935.html</link>
			<pubDate>Mon, 12 Oct 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113935.html</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">This is an early developer preview of Python 3.16</span><br />
<br />
<a href="https://www.python.org/downloads/release/python-3160a1/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3160a1/</a><br />
<br />
What’s new in Python 3.16?<br />
<br />
There’s plenty still to come in Python 3.16, but its first alpha is ready to try! Python 3.16.0a1 is the first of seven planned alpha releases.<br />
<br />
During the alpha phase, features may be added up until the start of the beta phase (May 4, 2027) and, if necessary, may be modified or deleted up until the release candidate phase (July 27, 2027). The final release is planned for October 5, 2027. Please keep in mind that this is a preview release and its use is not recommended for production environments.<br />
<br />
See <a href="https://docs.python.org/3.16/whatsnew/3.16.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.16</a> for changes so far.<br />
<br />
(Hey, <span style="font-weight: bold;" class="mycode_b">fellow core team member,</span> if there’s a feature you’d like highlighted in a future announcement, let Savannah know.)<br />
<br />
If you maintain a library or application, please try it with this alpha and let us know how it goes. Please report Python bugs on the <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">CPython issue tracker</a>.<br />
<br />
The next alpha, Python 3.16.0a2, is scheduled for November 10, 2026. The full schedule is in <a href="https://peps.python.org/pep-0826/" target="_blank" rel="noopener" class="mycode_url">PEP 826</a>.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.16/" target="_blank" rel="noopener" class="mycode_url">Python 3.16 documentation</a><br />
<br />
</li>
<li><a href="https://docs.python.org/3.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">Changelog</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">Support Python through the Python Software Foundation</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
For Python 3.16, this section will host the Python 3.16 Film Festival: one film pairing for each release, from the first alpha to the final version.<br />
<br />
Building CPython is a team sport. Every release reflects the time, skill, and dedication of a community that cares deeply about Python and the people who use it. In that spirit, the festival will celebrate collaboration and craftsmanship: the care people put into their work, and what they can make together.<br />
<br />
The Python 3.16 Film Festival opens with <a href="https://en.wikipedia.org/wiki/Ratatouille_(film)" target="_blank" rel="noopener" class="mycode_url"><span style="font-style: italic;" class="mycode_i">Ratatouille</span> (2007)</a>. Remy’s passion for cooking and his partnership with Linguini make it a fitting place to begin.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Great cooking is not for the faint of heart. You must be imaginative. Strong-hearted. You must try things that may not work. And you must not let anyone define your limits because of where you come from. Your only limit is your soul. What I say is true: anyone can cook, but only the fearless can be great.<br />
<br />
— Auguste Gusteau, <span style="font-style: italic;" class="mycode_i">Ratatouille</span> (2007)</blockquote>
<br />
Enjoy the new release<br />
<br />
Thank you to everyone who has contributed code, reviewed changes, written documentation, tested builds, and reported bugs. All of that work helps make Python and its releases possible. Please consider supporting Python by volunteering your time or encouraging your organisation to support the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Happy testing!<br />
<br />
Regards from beautiful Washington state,<br />
<br />
Your release team,<br />
<br />
Savannah Ostrowski<br />
<br />
Ned Deily<br />
<br />
Steve Dower<br />
<br />
Julien Palard]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">This is an early developer preview of Python 3.16</span><br />
<br />
<a href="https://www.python.org/downloads/release/python-3160a1/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3160a1/</a><br />
<br />
What’s new in Python 3.16?<br />
<br />
There’s plenty still to come in Python 3.16, but its first alpha is ready to try! Python 3.16.0a1 is the first of seven planned alpha releases.<br />
<br />
During the alpha phase, features may be added up until the start of the beta phase (May 4, 2027) and, if necessary, may be modified or deleted up until the release candidate phase (July 27, 2027). The final release is planned for October 5, 2027. Please keep in mind that this is a preview release and its use is not recommended for production environments.<br />
<br />
See <a href="https://docs.python.org/3.16/whatsnew/3.16.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.16</a> for changes so far.<br />
<br />
(Hey, <span style="font-weight: bold;" class="mycode_b">fellow core team member,</span> if there’s a feature you’d like highlighted in a future announcement, let Savannah know.)<br />
<br />
If you maintain a library or application, please try it with this alpha and let us know how it goes. Please report Python bugs on the <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">CPython issue tracker</a>.<br />
<br />
The next alpha, Python 3.16.0a2, is scheduled for November 10, 2026. The full schedule is in <a href="https://peps.python.org/pep-0826/" target="_blank" rel="noopener" class="mycode_url">PEP 826</a>.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.16/" target="_blank" rel="noopener" class="mycode_url">Python 3.16 documentation</a><br />
<br />
</li>
<li><a href="https://docs.python.org/3.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">Changelog</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">Support Python through the Python Software Foundation</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
For Python 3.16, this section will host the Python 3.16 Film Festival: one film pairing for each release, from the first alpha to the final version.<br />
<br />
Building CPython is a team sport. Every release reflects the time, skill, and dedication of a community that cares deeply about Python and the people who use it. In that spirit, the festival will celebrate collaboration and craftsmanship: the care people put into their work, and what they can make together.<br />
<br />
The Python 3.16 Film Festival opens with <a href="https://en.wikipedia.org/wiki/Ratatouille_(film)" target="_blank" rel="noopener" class="mycode_url"><span style="font-style: italic;" class="mycode_i">Ratatouille</span> (2007)</a>. Remy’s passion for cooking and his partnership with Linguini make it a fitting place to begin.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Great cooking is not for the faint of heart. You must be imaginative. Strong-hearted. You must try things that may not work. And you must not let anyone define your limits because of where you come from. Your only limit is your soul. What I say is true: anyone can cook, but only the fearless can be great.<br />
<br />
— Auguste Gusteau, <span style="font-style: italic;" class="mycode_i">Ratatouille</span> (2007)</blockquote>
<br />
Enjoy the new release<br />
<br />
Thank you to everyone who has contributed code, reviewed changes, written documentation, tested builds, and reported bugs. All of that work helps make Python and its releases possible. Please consider supporting Python by volunteering your time or encouraging your organisation to support the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Happy testing!<br />
<br />
Regards from beautiful Washington state,<br />
<br />
Your release team,<br />
<br />
Savannah Ostrowski<br />
<br />
Ned Deily<br />
<br />
Steve Dower<br />
<br />
Julien Palard]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python 3.15.0 (final) is here!]]></title>
			<link>https://sickgaming.net/thread-113751.html</link>
			<pubDate>Thu, 08 Oct 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113751.html</guid>
			<description><![CDATA[<img src="https://blog.python.org/_astro/python-3.15.Cl03WkPb_2ux1jo.webp" loading="lazy"  alt="[Image: python-3.15.Cl03WkPb_2ux1jo.webp]" class="mycode_img" /><br />
<br />
Python 3.15.0 is now available<br />
<br />
<a href="https://www.python.org/downloads/release/python-3150/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3150/</a><br />
<br />
This is the stable release of Python 3.15.0<br />
<br />
Python 3.15.0 is the newest major release of the Python programming language,<br />
and it contains many new features and optimisations compared to Python 3.14,<br />
in 5,643 commits from 1,012 contributors.<br />
<br />
Major new features of the 3.15 series, compared to 3.14<br />
<br />
Some of the major new features and changes in Python 3.15 are:<br />
<br />
Interpreter improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-sentinel" target="_blank" rel="noopener" class="mycode_url">PEP 661</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sentinel</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-utf8-default" target="_blank" rel="noopener" class="mycode_url">PEP 686</a>: Python now uses UTF-8 as the default encoding<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-unpacking-in-comprehensions" target="_blank" rel="noopener" class="mycode_url">PEP 798</a>: Unpacking in comprehensions<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-lazy-imports" target="_blank" rel="noopener" class="mycode_url">PEP 810</a>: Explicit lazy imports for faster startup times<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-frozendict" target="_blank" rel="noopener" class="mycode_url">PEP 814</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>frozendict</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0829/" target="_blank" rel="noopener" class="mycode_url">PEP 829</a>: Package startup configuration files<br />
<br />
</li>
<li>The <a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-jit" target="_blank" rel="noopener" class="mycode_url">experimental JIT compiler</a> has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#improved-error-messages" target="_blank" rel="noopener" class="mycode_url">Improved error messages</a><br />
<br />
</li>
</ul>
<br />
Significant improvements in the standard library<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-profiling-package" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: A dedicated profiling package for organizing Python profiling tools<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-sampling-profiler" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: Tachyon: High frequency statistical sampling profiler<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-more-color" target="_blank" rel="noopener" class="mycode_url">More color</a><br />
<br />
</li>
</ul>
<br />
New typing features<br />
<ul class="mycode_list"><li><a href="https://peps.python.org/pep-0728/" target="_blank" rel="noopener" class="mycode_url">PEP 728</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypedDict</code></div></div> with typed extra items<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#typing" target="_blank" rel="noopener" class="mycode_url">PEP 747</a>: Annotating type forms with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypeForm</code></div></div><br />
</li>
<li><a href="https://peps.python.org/pep-0800/" target="_blank" rel="noopener" class="mycode_url">PEP 800</a>: Disjoint bases in the type system<br />
<br />
</li>
</ul>
<br />
C API improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-pybyteswriter" target="_blank" rel="noopener" class="mycode_url">PEP 782</a>: A new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBytesWriter</code></div></div> C API to create a Python bytes object<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-c-api-interpreter-finalization" target="_blank" rel="noopener" class="mycode_url">PEP 788</a>: Protection against finalization in the C API<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-abi3t" target="_blank" rel="noopener" class="mycode_url">PEP 803, 820, 793</a>: Stable ABI for free-threaded builds and related C API<br />
<br />
</li>
</ul>
<br />
Build changes<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-frame-pointers" target="_blank" rel="noopener" class="mycode_url">PEP 831</a>: Frame pointers are enabled by default for improved system-level observability<br />
<br />
</li>
</ul>
<br />
Release changes<br />
<ul class="mycode_list"><li>The official Windows 64-bit binaries now <a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-windows-tail-calling-interpreter" target="_blank" rel="noopener" class="mycode_url">use the tail-calling interpreter</a><br />
<br />
</li>
<li>The official macOS binaries now install free-threading support by default<br />
<br />
</li>
</ul>
<br />
For more details on the changes to Python 3.15, see <a href="https://docs.python.org/3/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.15</a>.<br />
<br />
Attention macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> users<br />
<br />
When running IDLE or other GUI applications that use the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module, these applications may hang when using an application’s menu command that opens a dialog (for example, IDLE’s <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>About IDLE</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Settings</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Open Module</code></div></div> commands) resulting in a spinning beach ball with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Force Quit</code></div></div> needed.<br />
<br />
This problem is due to an operating system behavior change in macOS 27.0 that is believed to affect all current versions of the Tk graphics toolkit and thus the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module in all current Python versions.<br />
<br />
If you depend on Tk-based applications (like IDLE) on macOS, you may want to consider deferring installing macOS 27.0 until a Tk or macOS workaround is available or testing that your application workflow is not affected. Follow issue <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">#158053</a> for updates.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/" target="_blank" rel="noopener" class="mycode_url">Online documentation</a><br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0790/" target="_blank" rel="noopener" class="mycode_url">PEP 790</a>, 3.15 release schedule<br />
<br />
</li>
<li>Report bugs at <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">github.com/python/cpython/issues</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/python-dev/" target="_blank" rel="noopener" class="mycode_url">Help fund Python directly</a> (or via <a href="https://github.com/sponsors/python" target="_blank" rel="noopener" class="mycode_url">GitHub Sponsors</a>) and support <a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">the Python community</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
To celebrate the new 3.15, Barry Warsaw has a present for us!<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>I had this idea to whip up a little TUI adventure game that takes you through a What’s New in Python 3.15. I present to you “whatsnewt”:<br />
<br />
From the README:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>A TUI text adventure through what’s new in Python 3.15.<br />
<br />
You wake up in the Startup Foyer, somewhere inside the interpreter, and work your way to the Release Gate. Along the way there are eighteen puzzles, and every one of them is a real 3.15 feature you have to actually use. You’re not just answering boring questions, you’re actually writing and running code, in a Python 3.15 interpreter.<br />
<br />
Some puzzles require a type checker, and in those cases, answers are verified by pyrefly, which is a dependency for exactly that reason, and the verdict quotes what it says back.</blockquote>
<br />
The easiest way to play it is to run:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>uvx --python 3.15 whatsnewt</code></div></div><br />
And yes, there are easter eggs</blockquote>
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Huge thanks to Georgi Ker and Marie Nordin for the Python 3.15 logo!<br />
<br />
And also huge thanks to the Sovereign Tech Agency for supporting my work as release manager<br />
for Python 3.14 and 3.15 through the <a href="https://www.sovereign.tech/programs/fellowship" target="_blank" rel="noopener" class="mycode_url">Sovereign Tech Fellowship</a>.<br />
<br />
Salutations de Rennes,<br />
<br />
Your release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></description>
			<content:encoded><![CDATA[<img src="https://blog.python.org/_astro/python-3.15.Cl03WkPb_2ux1jo.webp" loading="lazy"  alt="[Image: python-3.15.Cl03WkPb_2ux1jo.webp]" class="mycode_img" /><br />
<br />
Python 3.15.0 is now available<br />
<br />
<a href="https://www.python.org/downloads/release/python-3150/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3150/</a><br />
<br />
This is the stable release of Python 3.15.0<br />
<br />
Python 3.15.0 is the newest major release of the Python programming language,<br />
and it contains many new features and optimisations compared to Python 3.14,<br />
in 5,643 commits from 1,012 contributors.<br />
<br />
Major new features of the 3.15 series, compared to 3.14<br />
<br />
Some of the major new features and changes in Python 3.15 are:<br />
<br />
Interpreter improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-sentinel" target="_blank" rel="noopener" class="mycode_url">PEP 661</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sentinel</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-utf8-default" target="_blank" rel="noopener" class="mycode_url">PEP 686</a>: Python now uses UTF-8 as the default encoding<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-unpacking-in-comprehensions" target="_blank" rel="noopener" class="mycode_url">PEP 798</a>: Unpacking in comprehensions<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-lazy-imports" target="_blank" rel="noopener" class="mycode_url">PEP 810</a>: Explicit lazy imports for faster startup times<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-frozendict" target="_blank" rel="noopener" class="mycode_url">PEP 814</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>frozendict</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0829/" target="_blank" rel="noopener" class="mycode_url">PEP 829</a>: Package startup configuration files<br />
<br />
</li>
<li>The <a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-jit" target="_blank" rel="noopener" class="mycode_url">experimental JIT compiler</a> has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#improved-error-messages" target="_blank" rel="noopener" class="mycode_url">Improved error messages</a><br />
<br />
</li>
</ul>
<br />
Significant improvements in the standard library<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-profiling-package" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: A dedicated profiling package for organizing Python profiling tools<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-sampling-profiler" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: Tachyon: High frequency statistical sampling profiler<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-more-color" target="_blank" rel="noopener" class="mycode_url">More color</a><br />
<br />
</li>
</ul>
<br />
New typing features<br />
<ul class="mycode_list"><li><a href="https://peps.python.org/pep-0728/" target="_blank" rel="noopener" class="mycode_url">PEP 728</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypedDict</code></div></div> with typed extra items<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#typing" target="_blank" rel="noopener" class="mycode_url">PEP 747</a>: Annotating type forms with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypeForm</code></div></div><br />
</li>
<li><a href="https://peps.python.org/pep-0800/" target="_blank" rel="noopener" class="mycode_url">PEP 800</a>: Disjoint bases in the type system<br />
<br />
</li>
</ul>
<br />
C API improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-pybyteswriter" target="_blank" rel="noopener" class="mycode_url">PEP 782</a>: A new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBytesWriter</code></div></div> C API to create a Python bytes object<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-c-api-interpreter-finalization" target="_blank" rel="noopener" class="mycode_url">PEP 788</a>: Protection against finalization in the C API<br />
<br />
</li>
<li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-abi3t" target="_blank" rel="noopener" class="mycode_url">PEP 803, 820, 793</a>: Stable ABI for free-threaded builds and related C API<br />
<br />
</li>
</ul>
<br />
Build changes<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-frame-pointers" target="_blank" rel="noopener" class="mycode_url">PEP 831</a>: Frame pointers are enabled by default for improved system-level observability<br />
<br />
</li>
</ul>
<br />
Release changes<br />
<ul class="mycode_list"><li>The official Windows 64-bit binaries now <a href="https://docs.python.org/3/whatsnew/3.15.html#whatsnew315-windows-tail-calling-interpreter" target="_blank" rel="noopener" class="mycode_url">use the tail-calling interpreter</a><br />
<br />
</li>
<li>The official macOS binaries now install free-threading support by default<br />
<br />
</li>
</ul>
<br />
For more details on the changes to Python 3.15, see <a href="https://docs.python.org/3/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.15</a>.<br />
<br />
Attention macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> users<br />
<br />
When running IDLE or other GUI applications that use the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module, these applications may hang when using an application’s menu command that opens a dialog (for example, IDLE’s <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>About IDLE</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Settings</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Open Module</code></div></div> commands) resulting in a spinning beach ball with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Force Quit</code></div></div> needed.<br />
<br />
This problem is due to an operating system behavior change in macOS 27.0 that is believed to affect all current versions of the Tk graphics toolkit and thus the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module in all current Python versions.<br />
<br />
If you depend on Tk-based applications (like IDLE) on macOS, you may want to consider deferring installing macOS 27.0 until a Tk or macOS workaround is available or testing that your application workflow is not affected. Follow issue <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">#158053</a> for updates.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3/" target="_blank" rel="noopener" class="mycode_url">Online documentation</a><br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0790/" target="_blank" rel="noopener" class="mycode_url">PEP 790</a>, 3.15 release schedule<br />
<br />
</li>
<li>Report bugs at <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">github.com/python/cpython/issues</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/python-dev/" target="_blank" rel="noopener" class="mycode_url">Help fund Python directly</a> (or via <a href="https://github.com/sponsors/python" target="_blank" rel="noopener" class="mycode_url">GitHub Sponsors</a>) and support <a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">the Python community</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
To celebrate the new 3.15, Barry Warsaw has a present for us!<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>I had this idea to whip up a little TUI adventure game that takes you through a What’s New in Python 3.15. I present to you “whatsnewt”:<br />
<br />
From the README:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>A TUI text adventure through what’s new in Python 3.15.<br />
<br />
You wake up in the Startup Foyer, somewhere inside the interpreter, and work your way to the Release Gate. Along the way there are eighteen puzzles, and every one of them is a real 3.15 feature you have to actually use. You’re not just answering boring questions, you’re actually writing and running code, in a Python 3.15 interpreter.<br />
<br />
Some puzzles require a type checker, and in those cases, answers are verified by pyrefly, which is a dependency for exactly that reason, and the verdict quotes what it says back.</blockquote>
<br />
The easiest way to play it is to run:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>uvx --python 3.15 whatsnewt</code></div></div><br />
And yes, there are easter eggs</blockquote>
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Huge thanks to Georgi Ker and Marie Nordin for the Python 3.15 logo!<br />
<br />
And also huge thanks to the Sovereign Tech Agency for supporting my work as release manager<br />
for Python 3.14 and 3.15 through the <a href="https://www.sovereign.tech/programs/fellowship" target="_blank" rel="noopener" class="mycode_url">Sovereign Tech Fellowship</a>.<br />
<br />
Salutations de Rennes,<br />
<br />
Your release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python 3.15.0 candidate 3 is here!]]></title>
			<link>https://sickgaming.net/thread-113583.html</link>
			<pubDate>Thu, 01 Oct 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113583.html</guid>
			<description><![CDATA[<a href="https://discuss.python.org/t/adding-a-third-3-12-release-candidate/33605" target="_blank" rel="noopener" class="mycode_url">Following</a><br />
<a href="https://discuss.python.org/t/incremental-gc-and-pushing-back-the-3-13-0-release/65285" target="_blank" rel="noopener" class="mycode_url">recent</a><br />
<a href="https://discuss.python.org/t/early-3-14-0-rc2-and-extra-rc3/102151" target="_blank" rel="noopener" class="mycode_url">tradition</a>,<br />
here’s a surprise third release candidate for Python 3.15.0!<br />
<br />
We got some last-minute lazy-import release blockers, and it makes sense to<br />
include them in 3.15.0 final. It also makes sense to give a bit of time to test<br />
them properly, so this week’s planned 3.15.0 final is postponed until next week,<br />
and here’s an extra 3.15.0rc3.<br />
<br />
<a href="https://www.python.org/downloads/release/python-3150rc3/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3150rc3</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b">This is a candidate preview of Python 3.15</span><br />
<br />
This release, <span style="font-weight: bold;" class="mycode_b">3.15.0rc3</span>, is the final planned release candidate, containing around 156 bugfixes, build improvements and documentation changes from 82 contributors since 3.15.0rc2. Entering the release candidate phase, only reviewed code changes which are clear bug fixes are allowed between this release candidate and the final release.<br />
<br />
The next release of Python 3.15 will be 3.15.0 final, scheduled for 2026-10-09.<br />
<br />
There will be <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">no ABI changes</span></span> from this point forward in the 3.15 series, and the goal is that there will be as few code changes as possible.<br />
<br />
Call to action<br />
<br />
We <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">strongly encourage</span></span> maintainers of third-party Python projects to <a href="https://hugovk.dev/blog/2026/help-test-python-315/" target="_blank" rel="noopener" class="mycode_url">prepare their projects for 3.15</a> during this phase, and publish Python 3.15 wheels on PyPI to be ready for the final release of 3.15.0, and to help other projects do their own testing. Any binary wheels built against Python 3.15.0 release candidates <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">will work</span></span> with future versions of Python 3.15. As always, report any issues to <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">the Python bug tracker</a>.<br />
<br />
Please keep in mind that this is a preview release and while it’s as close to the final release as we can get it, its use is <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">not</span></span> recommended for production environments.<br />
<br />
Core team: extra time to work on documentation<br />
<ul class="mycode_list"><li>Are all your changes properly documented?<br />
<br />
</li>
<li>Are they mentioned in <a href="https://docs.python.org/3.15/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s New</a>?<br />
<br />
</li>
<li>Did you notice other changes with insufficient documentation?<br />
<br />
</li>
</ul>
<br />
Major new features of the 3.15 series, compared to 3.14<br />
<br />
Some of the major new features and changes in Python 3.15 are:<br />
<br />
Interpreter improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-lazy-imports" target="_blank" rel="noopener" class="mycode_url">PEP 810</a>: Explicit lazy imports for faster startup times<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frozendict" target="_blank" rel="noopener" class="mycode_url">PEP 814</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>frozendict</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sentinel" target="_blank" rel="noopener" class="mycode_url">PEP 661</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sentinel</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-unpacking-in-comprehensions" target="_blank" rel="noopener" class="mycode_url">PEP 798</a>: Unpacking in comprehensions<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-utf8-default" target="_blank" rel="noopener" class="mycode_url">PEP 686</a>: Python now uses UTF-8 as the default encoding<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-startup-files" target="_blank" rel="noopener" class="mycode_url">PEP 829</a>: Package startup configuration files<br />
<br />
</li>
<li>The <a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-jit" target="_blank" rel="noopener" class="mycode_url">experimental JIT compiler</a> has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#improved-error-messages" target="_blank" rel="noopener" class="mycode_url">Improved error messages</a><br />
<br />
</li>
</ul>
<br />
Significant improvements in the standard library<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sampling-profiler" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: Tachyon: High frequency statistical sampling profiler<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-profiling-package" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: A dedicated profiling package for organizing Python profiling tools<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-more-color" target="_blank" rel="noopener" class="mycode_url">More color</a><br />
<br />
</li>
</ul>
<br />
New typing features<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeddict" target="_blank" rel="noopener" class="mycode_url">PEP 728</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypedDict</code></div></div> with typed extra items<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeform" target="_blank" rel="noopener" class="mycode_url">PEP 747</a>: Annotating type forms with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypeForm</code></div></div><br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-disjoint-base" target="_blank" rel="noopener" class="mycode_url">PEP 800</a>: Disjoint bases in the type system<br />
<br />
</li>
</ul>
<br />
C API improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-abi3t" target="_blank" rel="noopener" class="mycode_url">PEP 803, 820, 793</a>: Stable ABI for free-threaded builds and related C API<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-pybyteswriter" target="_blank" rel="noopener" class="mycode_url">PEP 782</a>: A new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBytesWriter</code></div></div> C API to create a Python bytes object<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-c-api-interpreter-finalization" target="_blank" rel="noopener" class="mycode_url">PEP 788</a>: Protection against finalization in the C API<br />
<br />
</li>
</ul>
<br />
Build changes<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frame-pointers" target="_blank" rel="noopener" class="mycode_url">PEP 831</a>: Frame pointers are enabled by default for improved system-level observability<br />
<br />
</li>
</ul>
<br />
Release changes<br />
<ul class="mycode_list"><li>The official Windows 64-bit binaries now <a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-windows-tail-calling-interpreter" target="_blank" rel="noopener" class="mycode_url">use the tail-calling interpreter</a><br />
<br />
</li>
<li>The official macOS binaries now install free-threading support by default<br />
<br />
</li>
<li>(Hey, <span style="font-weight: bold;" class="mycode_b">fellow core team member,</span> if a feature you find important is missing from this list, let Hugo know.)<br />
<br />
</li>
</ul>
<br />
For more details on the changes to Python 3.15, see <a href="https://docs.python.org/3.15/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.15</a>.<br />
<br />
Attention macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> users<br />
<br />
When running IDLE or other GUI applications that use the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module, these<br />
applications may hang when using an application’s menu command that opens a<br />
dialog (for example, IDLE’s <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>About IDLE</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Settings</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Open Module</code></div></div> commands)<br />
resulting in a spinning beach ball with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Force Quit</code></div></div> needed.<br />
<br />
This problem is due to an operating system behavior change in macOS 27.0 that is<br />
believed to affect all current versions of the Tk graphics toolkit and thus the<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module in all current Python versions.<br />
<br />
If you depend on Tk-based applications (like IDLE) on macOS, you may want to<br />
consider deferring installing macOS 27.0 until a Tk or macOS workaround is<br />
available or testing that your application workflow is not affected. Follow<br />
issue <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">#158053</a> for updates.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/" target="_blank" rel="noopener" class="mycode_url">Online documentation</a><br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0790/" target="_blank" rel="noopener" class="mycode_url">PEP 790</a>, 3.15 release schedule<br />
<br />
</li>
<li>Report bugs at <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">https://github.com/python/cpython/issues</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/python-dev/" target="_blank" rel="noopener" class="mycode_url">Help fund Python directly</a> (or via <a href="https://github.com/sponsors/python" target="_blank" rel="noopener" class="mycode_url">GitHub Sponsors</a>) and support <a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">the Python community</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>At this moment the bow was in the hands of Eurymachus, who was warming<br />
it by the fire, but even so he could not string it, and he was greatly<br />
grieved. He heaved a deep sigh and said, “I grieve for myself and for<br />
us all; I grieve that I shall have to forgo the marriage, but I do not<br />
care nearly so much about this, for there are plenty of other women in<br />
Ithaca and elsewhere; what I feel most is the fact of our being so<br />
inferior to Ulysses in strength that we cannot string his bow. This<br />
will disgrace us in the eyes of those who are yet unborn.”</blockquote>
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Regards from a sunny autumnal Helsinki.<br />
<br />
Your release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></description>
			<content:encoded><![CDATA[<a href="https://discuss.python.org/t/adding-a-third-3-12-release-candidate/33605" target="_blank" rel="noopener" class="mycode_url">Following</a><br />
<a href="https://discuss.python.org/t/incremental-gc-and-pushing-back-the-3-13-0-release/65285" target="_blank" rel="noopener" class="mycode_url">recent</a><br />
<a href="https://discuss.python.org/t/early-3-14-0-rc2-and-extra-rc3/102151" target="_blank" rel="noopener" class="mycode_url">tradition</a>,<br />
here’s a surprise third release candidate for Python 3.15.0!<br />
<br />
We got some last-minute lazy-import release blockers, and it makes sense to<br />
include them in 3.15.0 final. It also makes sense to give a bit of time to test<br />
them properly, so this week’s planned 3.15.0 final is postponed until next week,<br />
and here’s an extra 3.15.0rc3.<br />
<br />
<a href="https://www.python.org/downloads/release/python-3150rc3/" target="_blank" rel="noopener" class="mycode_url">python.org/downloads/release/python-3150rc3</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b">This is a candidate preview of Python 3.15</span><br />
<br />
This release, <span style="font-weight: bold;" class="mycode_b">3.15.0rc3</span>, is the final planned release candidate, containing around 156 bugfixes, build improvements and documentation changes from 82 contributors since 3.15.0rc2. Entering the release candidate phase, only reviewed code changes which are clear bug fixes are allowed between this release candidate and the final release.<br />
<br />
The next release of Python 3.15 will be 3.15.0 final, scheduled for 2026-10-09.<br />
<br />
There will be <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">no ABI changes</span></span> from this point forward in the 3.15 series, and the goal is that there will be as few code changes as possible.<br />
<br />
Call to action<br />
<br />
We <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">strongly encourage</span></span> maintainers of third-party Python projects to <a href="https://hugovk.dev/blog/2026/help-test-python-315/" target="_blank" rel="noopener" class="mycode_url">prepare their projects for 3.15</a> during this phase, and publish Python 3.15 wheels on PyPI to be ready for the final release of 3.15.0, and to help other projects do their own testing. Any binary wheels built against Python 3.15.0 release candidates <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">will work</span></span> with future versions of Python 3.15. As always, report any issues to <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">the Python bug tracker</a>.<br />
<br />
Please keep in mind that this is a preview release and while it’s as close to the final release as we can get it, its use is <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">not</span></span> recommended for production environments.<br />
<br />
Core team: extra time to work on documentation<br />
<ul class="mycode_list"><li>Are all your changes properly documented?<br />
<br />
</li>
<li>Are they mentioned in <a href="https://docs.python.org/3.15/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s New</a>?<br />
<br />
</li>
<li>Did you notice other changes with insufficient documentation?<br />
<br />
</li>
</ul>
<br />
Major new features of the 3.15 series, compared to 3.14<br />
<br />
Some of the major new features and changes in Python 3.15 are:<br />
<br />
Interpreter improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-lazy-imports" target="_blank" rel="noopener" class="mycode_url">PEP 810</a>: Explicit lazy imports for faster startup times<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frozendict" target="_blank" rel="noopener" class="mycode_url">PEP 814</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>frozendict</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sentinel" target="_blank" rel="noopener" class="mycode_url">PEP 661</a>: Add <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sentinel</code></div></div> built-in type<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-unpacking-in-comprehensions" target="_blank" rel="noopener" class="mycode_url">PEP 798</a>: Unpacking in comprehensions<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-utf8-default" target="_blank" rel="noopener" class="mycode_url">PEP 686</a>: Python now uses UTF-8 as the default encoding<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-startup-files" target="_blank" rel="noopener" class="mycode_url">PEP 829</a>: Package startup configuration files<br />
<br />
</li>
<li>The <a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-jit" target="_blank" rel="noopener" class="mycode_url">experimental JIT compiler</a> has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#improved-error-messages" target="_blank" rel="noopener" class="mycode_url">Improved error messages</a><br />
<br />
</li>
</ul>
<br />
Significant improvements in the standard library<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sampling-profiler" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: Tachyon: High frequency statistical sampling profiler<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-profiling-package" target="_blank" rel="noopener" class="mycode_url">PEP 799</a>: A dedicated profiling package for organizing Python profiling tools<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-more-color" target="_blank" rel="noopener" class="mycode_url">More color</a><br />
<br />
</li>
</ul>
<br />
New typing features<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeddict" target="_blank" rel="noopener" class="mycode_url">PEP 728</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypedDict</code></div></div> with typed extra items<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeform" target="_blank" rel="noopener" class="mycode_url">PEP 747</a>: Annotating type forms with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>TypeForm</code></div></div><br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-disjoint-base" target="_blank" rel="noopener" class="mycode_url">PEP 800</a>: Disjoint bases in the type system<br />
<br />
</li>
</ul>
<br />
C API improvements<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-abi3t" target="_blank" rel="noopener" class="mycode_url">PEP 803, 820, 793</a>: Stable ABI for free-threaded builds and related C API<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-pybyteswriter" target="_blank" rel="noopener" class="mycode_url">PEP 782</a>: A new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBytesWriter</code></div></div> C API to create a Python bytes object<br />
<br />
</li>
<li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-c-api-interpreter-finalization" target="_blank" rel="noopener" class="mycode_url">PEP 788</a>: Protection against finalization in the C API<br />
<br />
</li>
</ul>
<br />
Build changes<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frame-pointers" target="_blank" rel="noopener" class="mycode_url">PEP 831</a>: Frame pointers are enabled by default for improved system-level observability<br />
<br />
</li>
</ul>
<br />
Release changes<br />
<ul class="mycode_list"><li>The official Windows 64-bit binaries now <a href="https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-windows-tail-calling-interpreter" target="_blank" rel="noopener" class="mycode_url">use the tail-calling interpreter</a><br />
<br />
</li>
<li>The official macOS binaries now install free-threading support by default<br />
<br />
</li>
<li>(Hey, <span style="font-weight: bold;" class="mycode_b">fellow core team member,</span> if a feature you find important is missing from this list, let Hugo know.)<br />
<br />
</li>
</ul>
<br />
For more details on the changes to Python 3.15, see <a href="https://docs.python.org/3.15/whatsnew/3.15.html" target="_blank" rel="noopener" class="mycode_url">What’s new in Python 3.15</a>.<br />
<br />
Attention macOS 27.0 <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>IDLE</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> users<br />
<br />
When running IDLE or other GUI applications that use the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module, these<br />
applications may hang when using an application’s menu command that opens a<br />
dialog (for example, IDLE’s <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>About IDLE</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Settings</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Open Module</code></div></div> commands)<br />
resulting in a spinning beach ball with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Force Quit</code></div></div> needed.<br />
<br />
This problem is due to an operating system behavior change in macOS 27.0 that is<br />
believed to affect all current versions of the Tk graphics toolkit and thus the<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>tkinter</code></div></div> module in all current Python versions.<br />
<br />
If you depend on Tk-based applications (like IDLE) on macOS, you may want to<br />
consider deferring installing macOS 27.0 until a Tk or macOS workaround is<br />
available or testing that your application workflow is not affected. Follow<br />
issue <a href="https://github.com/python/cpython/issues/158053" target="_blank" rel="noopener" class="mycode_url">#158053</a> for updates.<br />
<br />
More resources<br />
<ul class="mycode_list"><li><a href="https://docs.python.org/3.15/" target="_blank" rel="noopener" class="mycode_url">Online documentation</a><br />
<br />
</li>
<li><a href="https://peps.python.org/pep-0790/" target="_blank" rel="noopener" class="mycode_url">PEP 790</a>, 3.15 release schedule<br />
<br />
</li>
<li>Report bugs at <a href="https://github.com/python/cpython/issues" target="_blank" rel="noopener" class="mycode_url">https://github.com/python/cpython/issues</a><br />
<br />
</li>
<li><a href="https://www.python.org/psf/donations/python-dev/" target="_blank" rel="noopener" class="mycode_url">Help fund Python directly</a> (or via <a href="https://github.com/sponsors/python" target="_blank" rel="noopener" class="mycode_url">GitHub Sponsors</a>) and support <a href="https://www.python.org/psf/donations/" target="_blank" rel="noopener" class="mycode_url">the Python community</a><br />
<br />
</li>
</ul>
<br />
And now for something completely different<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>At this moment the bow was in the hands of Eurymachus, who was warming<br />
it by the fire, but even so he could not string it, and he was greatly<br />
grieved. He heaved a deep sigh and said, “I grieve for myself and for<br />
us all; I grieve that I shall have to forgo the marriage, but I do not<br />
care nearly so much about this, for there are plenty of other women in<br />
Ithaca and elsewhere; what I feel most is the fact of our being so<br />
inferior to Ulysses in strength that we cannot string his bow. This<br />
will disgrace us in the eyes of those who are yet unborn.”</blockquote>
<br />
Enjoy the new release<br />
<br />
Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Regards from a sunny autumnal Helsinki.<br />
<br />
Your release team,<br />
<br />
Hugo van Kemenade<br />
<br />
Ned Deily<br />
<br />
Steve Dower]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python 3.10.22, 3.11.17, 3.12.15, 3.13.16 and 3.14.8 are now available!]]></title>
			<link>https://sickgaming.net/thread-113579.html</link>
			<pubDate>Wed, 30 Sep 2026 22:00:00 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113579.html</guid>
			<description><![CDATA[A full sweep of Python releases is here: <span style="font-weight: bold;" class="mycode_b">Python 3.10.22, 3.11.17, 3.12.15, 3.13.16 and 3.14.8 are now available!</span> One last lap around the Sun for Python 3.10, and security updates across all five series.<br />
<br />
Get them here:<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-31022/" target="_blank" rel="noopener" class="mycode_url">Python 3.10.22</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31117/" target="_blank" rel="noopener" class="mycode_url">Python 3.11.17</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31215/" target="_blank" rel="noopener" class="mycode_url">Python 3.12.15</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31316/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.16</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-3148/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.8</a><br />
<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Python 3.10.22 is the final release of Python 3.10.</span> After five years, the series has reached end of life and will receive no further security updates. If you are still using Python 3.10, please plan your upgrade to a supported version.<br />
<br />
Python 3.11 remains in security-fix-only mode until October 2027, as described in <a href="https://peps.python.org/pep-0664/" target="_blank" rel="noopener" class="mycode_url">PEP 664</a>. Security releases are made as needed, with no fixed cadence.<br />
<br />
Python 3.10.22 and 3.11.17 are <span style="font-weight: bold;" class="mycode_b">source-only</span>. There are no Windows or macOS installers: 3.10.11 and 3.11.9 were the last releases in their respective series to include binary installers. These two releases contain security fixes rather than new features.<br />
<br />
Python 3.12.15 is also a source-only security release, with security support continuing until October 2028. Python 3.13.16 is the <span style="font-weight: bold;" class="mycode_b">last full maintenance release of 3.13</span>; future 3.13 releases will contain security fixes only. Python 3.14.8 is a maintenance release, and both 3.13.16 and 3.14.8 include binary installers. See their release pages above for their full security content and other changes.<br />
<br />
<a href="https://discuss.python.org/t/python-3-10-22-and-3-11-17-are-now-available/109296" target="_blank" rel="noopener" class="mycode_url">Discuss this release announcement</a>.<br />
<br />
Security content in all five releases<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/158446" target="_blank" rel="noopener" class="mycode_url">gh-158446</a>: Fix crashes or incorrect output when formatting float or complex values with precision close to INT_MAX.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19553" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19553</a> — <a href="https://github.com/python/cpython/issues/156793" target="_blank" rel="noopener" class="mycode_url">gh-156793</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ssl.SSLContext.wrap_bio()</code></div></div> now validates its <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_side</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_hostname</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>session</code></div></div> arguments. <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>asyncio</code></div></div> also validates TLS <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_hostname</code></div></div> arguments. On Python 3.10, 3.11, and 3.12, missing hostnames with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>check_hostname</code></div></div> enabled emit <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>DeprecationWarning</code></div></div> for compatibility; they raise <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ValueError</code></div></div> on Python 3.13 and later.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-82049" target="_blank" rel="noopener" class="mycode_url">CVE-2026-82049</a> — <a href="https://github.com/python/cpython/issues/157190" target="_blank" rel="noopener" class="mycode_url">gh-157190</a>: Fix a tarfile extraction-filter vulnerability involving hard links to symbolic links that could expose files outside the destination and change their permissions or modification times.<br />
<br />
</li>
<li><a href="https://github.com/python/cpython/issues/157953" target="_blank" rel="noopener" class="mycode_url">gh-157953</a>: Update bundled libexpat to version 2.8.5.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-15310" target="_blank" rel="noopener" class="mycode_url">CVE-2026-15310</a> — <a href="https://github.com/python/cpython/issues/156002" target="_blank" rel="noopener" class="mycode_url">gh-156002</a>: Bound <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>zipfile</code></div></div> decompression per read for bzip2 and LZMA members, and for Zstandard members on Python 3.14, preventing unbounded allocations from small compressed members. Third-party decompressors supplied by monkey-patching <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>_get_decompressor()</code></div></div> that lack <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>needs_input</code></div></div> and two-argument <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>decompress()</code></div></div> remain vulnerable.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19672" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19672</a> — <a href="https://github.com/python/cpython/issues/155999" target="_blank" rel="noopener" class="mycode_url">gh-155999</a>: Prevent tarfile extraction filters from creating directories outside the destination for paths that leave it and then return.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19445" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19445</a> — <a href="https://github.com/python/cpython/issues/156293" target="_blank" rel="noopener" class="mycode_url">gh-156293</a>: Fix an ssl crash when an SNI callback switches contexts and the original callback context is no longer referenced.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-17084" target="_blank" rel="noopener" class="mycode_url">CVE-2026-17084</a> — <a href="https://github.com/python/cpython/issues/155292" target="_blank" rel="noopener" class="mycode_url">gh-155292</a>: Restrict stringprep and the IDNA codec to Unicode codepoint attributes defined by RFC 3454.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-15806" target="_blank" rel="noopener" class="mycode_url">CVE-2026-15806</a> — <a href="https://github.com/python/cpython/issues/155694" target="_blank" rel="noopener" class="mycode_url">gh-155694</a>: Scope urllib.request HTTPPasswordMgr credentials by URL scheme to prevent HTTPS credentials from being used for matching HTTP URLs.<br />
<br />
</li>
</ul>
<br />
Additional security content by version<br />
<br />
Python 3.10.22, 3.11.17, 3.12.15 and 3.13.16<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-87910" target="_blank" rel="noopener" class="mycode_url">CVE-2026-87910</a> — <a href="https://github.com/python/cpython/issues/157265" target="_blank" rel="noopener" class="mycode_url">gh-157265</a>: Apply tarfile extraction filters when a link falls back to extracting an archive member, skipping members rejected by the filter.<br />
<br />
</li>
</ul>
<br />
Python 3.13.16 and 3.14.8<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/158010" target="_blank" rel="noopener" class="mycode_url">gh-158010</a>: Update bundled OpenSSL to <a href="https://openssl-library.org/news/secadv/20260929.txt" target="_blank" rel="noopener" class="mycode_url">3.5.9</a>. In Python 3.13.16 this applies to Windows, macOS and Android, moving from OpenSSL 3.0.21 to the 3.5 LTS series. In Python 3.14.8 it applies to Windows, macOS, Android and iOS. The source-only Python 3.10–3.12 releases do not bundle OpenSSL.<br />
<br />
</li>
</ul>
<br />
Python 3.10.22<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/149018" target="_blank" rel="noopener" class="mycode_url">gh-149018</a>: Improve protection against XML hash-flooding attacks in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>xml.parsers.expat</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>xml.etree.ElementTree</code></div></div> when compiled with libexpat 2.8.0 or later.<br />
<br />
</li>
</ul>
<br />
This XML hash-flooding protection was already included in Python 3.11.16.<br />
<br />
For the full details, see the <a href="https://docs.python.org/release/3.10.22/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.10.22 changelog</a>, <a href="https://docs.python.org/release/3.11.17/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.11.17 changelog</a>, <a href="https://docs.python.org/release/3.12.15/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.12.15 changelog</a>, <a href="https://docs.python.org/release/3.13.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.13.16 changelog</a>, and <a href="https://docs.python.org/release/3.14.8/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.14.8 changelog</a>.<br />
<br />
And now for something completely different<br />
<br />
When two black holes merge, the newly formed black hole is distorted. It settles towards a stationary state by emitting gravitational waves in a process called <span style="font-weight: bold;" class="mycode_b">ringdown</span>. Like a struck bell, it oscillates with a signal that fades away. These oscillations are described by quasinormal modes; their frequencies and decay times depend on the final black hole’s mass and spin. You can watch spacetime doing its final ringing in <a href="https://svs.gsfc.nasa.gov/13197" target="_blank" rel="noopener" class="mycode_url">this NASA simulation</a>.<br />
<br />
We started Python 3.10 with <a href="https://blog.python.org/2021/10/python-3100-is-available/" target="_blank" rel="noopener" class="mycode_url">a trip inside a Schwarzschild black hole</a>, so it seems only fair to finish with black holes as well :)<br />
<br />
This is Python 3.10’s ringdown. One last release before we switch off the release machinery. Five years of features, fixes, stubborn buildbots, and a rather unreasonable number of tarballs. I cannot quite believe I am writing the last one.<br />
<br />
Thank you to everyone who contributed patches, reviewed changes, tested releases, reported bugs, or helped us get a release out when the universe seemed determined to prevent it. It has been a privilege to be your release manager for this series.<br />
<br />
Python 3.11 still has another year of security fixes ahead of it, so you have not escaped me yet :)<br />
<br />
We hope you enjoy the new releases!<br />
<br />
Thank you to all the volunteers who made these releases possible. Please consider supporting Python by contributing your time or through the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your friendly release team,<br />
<br />
<a href="https://discuss.python.org/u/hugovk" target="_blank" rel="noopener" class="mycode_url">Hugo van Kemenade</a><br />
<br />
<a href="https://discuss.python.org/u/thomas" target="_blank" rel="noopener" class="mycode_url">Thomas Wouters</a><br />
<br />
<a href="https://discuss.python.org/u/pablogsal" target="_blank" rel="noopener" class="mycode_url">Pablo Galindo Salgado</a>]]></description>
			<content:encoded><![CDATA[A full sweep of Python releases is here: <span style="font-weight: bold;" class="mycode_b">Python 3.10.22, 3.11.17, 3.12.15, 3.13.16 and 3.14.8 are now available!</span> One last lap around the Sun for Python 3.10, and security updates across all five series.<br />
<br />
Get them here:<br />
<ul class="mycode_list"><li><a href="https://www.python.org/downloads/release/python-31022/" target="_blank" rel="noopener" class="mycode_url">Python 3.10.22</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31117/" target="_blank" rel="noopener" class="mycode_url">Python 3.11.17</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31215/" target="_blank" rel="noopener" class="mycode_url">Python 3.12.15</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-31316/" target="_blank" rel="noopener" class="mycode_url">Python 3.13.16</a><br />
<br />
</li>
<li><a href="https://www.python.org/downloads/release/python-3148/" target="_blank" rel="noopener" class="mycode_url">Python 3.14.8</a><br />
<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Python 3.10.22 is the final release of Python 3.10.</span> After five years, the series has reached end of life and will receive no further security updates. If you are still using Python 3.10, please plan your upgrade to a supported version.<br />
<br />
Python 3.11 remains in security-fix-only mode until October 2027, as described in <a href="https://peps.python.org/pep-0664/" target="_blank" rel="noopener" class="mycode_url">PEP 664</a>. Security releases are made as needed, with no fixed cadence.<br />
<br />
Python 3.10.22 and 3.11.17 are <span style="font-weight: bold;" class="mycode_b">source-only</span>. There are no Windows or macOS installers: 3.10.11 and 3.11.9 were the last releases in their respective series to include binary installers. These two releases contain security fixes rather than new features.<br />
<br />
Python 3.12.15 is also a source-only security release, with security support continuing until October 2028. Python 3.13.16 is the <span style="font-weight: bold;" class="mycode_b">last full maintenance release of 3.13</span>; future 3.13 releases will contain security fixes only. Python 3.14.8 is a maintenance release, and both 3.13.16 and 3.14.8 include binary installers. See their release pages above for their full security content and other changes.<br />
<br />
<a href="https://discuss.python.org/t/python-3-10-22-and-3-11-17-are-now-available/109296" target="_blank" rel="noopener" class="mycode_url">Discuss this release announcement</a>.<br />
<br />
Security content in all five releases<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/158446" target="_blank" rel="noopener" class="mycode_url">gh-158446</a>: Fix crashes or incorrect output when formatting float or complex values with precision close to INT_MAX.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19553" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19553</a> — <a href="https://github.com/python/cpython/issues/156793" target="_blank" rel="noopener" class="mycode_url">gh-156793</a>: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ssl.SSLContext.wrap_bio()</code></div></div> now validates its <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_side</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_hostname</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>session</code></div></div> arguments. <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>asyncio</code></div></div> also validates TLS <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>server_hostname</code></div></div> arguments. On Python 3.10, 3.11, and 3.12, missing hostnames with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>check_hostname</code></div></div> enabled emit <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>DeprecationWarning</code></div></div> for compatibility; they raise <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ValueError</code></div></div> on Python 3.13 and later.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-82049" target="_blank" rel="noopener" class="mycode_url">CVE-2026-82049</a> — <a href="https://github.com/python/cpython/issues/157190" target="_blank" rel="noopener" class="mycode_url">gh-157190</a>: Fix a tarfile extraction-filter vulnerability involving hard links to symbolic links that could expose files outside the destination and change their permissions or modification times.<br />
<br />
</li>
<li><a href="https://github.com/python/cpython/issues/157953" target="_blank" rel="noopener" class="mycode_url">gh-157953</a>: Update bundled libexpat to version 2.8.5.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-15310" target="_blank" rel="noopener" class="mycode_url">CVE-2026-15310</a> — <a href="https://github.com/python/cpython/issues/156002" target="_blank" rel="noopener" class="mycode_url">gh-156002</a>: Bound <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>zipfile</code></div></div> decompression per read for bzip2 and LZMA members, and for Zstandard members on Python 3.14, preventing unbounded allocations from small compressed members. Third-party decompressors supplied by monkey-patching <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>_get_decompressor()</code></div></div> that lack <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>needs_input</code></div></div> and two-argument <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>decompress()</code></div></div> remain vulnerable.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19672" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19672</a> — <a href="https://github.com/python/cpython/issues/155999" target="_blank" rel="noopener" class="mycode_url">gh-155999</a>: Prevent tarfile extraction filters from creating directories outside the destination for paths that leave it and then return.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-19445" target="_blank" rel="noopener" class="mycode_url">CVE-2026-19445</a> — <a href="https://github.com/python/cpython/issues/156293" target="_blank" rel="noopener" class="mycode_url">gh-156293</a>: Fix an ssl crash when an SNI callback switches contexts and the original callback context is no longer referenced.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-17084" target="_blank" rel="noopener" class="mycode_url">CVE-2026-17084</a> — <a href="https://github.com/python/cpython/issues/155292" target="_blank" rel="noopener" class="mycode_url">gh-155292</a>: Restrict stringprep and the IDNA codec to Unicode codepoint attributes defined by RFC 3454.<br />
<br />
</li>
<li><a href="https://www.cve.org/CVERecord?id=CVE-2026-15806" target="_blank" rel="noopener" class="mycode_url">CVE-2026-15806</a> — <a href="https://github.com/python/cpython/issues/155694" target="_blank" rel="noopener" class="mycode_url">gh-155694</a>: Scope urllib.request HTTPPasswordMgr credentials by URL scheme to prevent HTTPS credentials from being used for matching HTTP URLs.<br />
<br />
</li>
</ul>
<br />
Additional security content by version<br />
<br />
Python 3.10.22, 3.11.17, 3.12.15 and 3.13.16<br />
<ul class="mycode_list"><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-87910" target="_blank" rel="noopener" class="mycode_url">CVE-2026-87910</a> — <a href="https://github.com/python/cpython/issues/157265" target="_blank" rel="noopener" class="mycode_url">gh-157265</a>: Apply tarfile extraction filters when a link falls back to extracting an archive member, skipping members rejected by the filter.<br />
<br />
</li>
</ul>
<br />
Python 3.13.16 and 3.14.8<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/158010" target="_blank" rel="noopener" class="mycode_url">gh-158010</a>: Update bundled OpenSSL to <a href="https://openssl-library.org/news/secadv/20260929.txt" target="_blank" rel="noopener" class="mycode_url">3.5.9</a>. In Python 3.13.16 this applies to Windows, macOS and Android, moving from OpenSSL 3.0.21 to the 3.5 LTS series. In Python 3.14.8 it applies to Windows, macOS, Android and iOS. The source-only Python 3.10–3.12 releases do not bundle OpenSSL.<br />
<br />
</li>
</ul>
<br />
Python 3.10.22<br />
<ul class="mycode_list"><li><a href="https://github.com/python/cpython/issues/149018" target="_blank" rel="noopener" class="mycode_url">gh-149018</a>: Improve protection against XML hash-flooding attacks in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>xml.parsers.expat</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>xml.etree.ElementTree</code></div></div> when compiled with libexpat 2.8.0 or later.<br />
<br />
</li>
</ul>
<br />
This XML hash-flooding protection was already included in Python 3.11.16.<br />
<br />
For the full details, see the <a href="https://docs.python.org/release/3.10.22/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.10.22 changelog</a>, <a href="https://docs.python.org/release/3.11.17/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.11.17 changelog</a>, <a href="https://docs.python.org/release/3.12.15/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.12.15 changelog</a>, <a href="https://docs.python.org/release/3.13.16/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.13.16 changelog</a>, and <a href="https://docs.python.org/release/3.14.8/whatsnew/changelog.html" target="_blank" rel="noopener" class="mycode_url">3.14.8 changelog</a>.<br />
<br />
And now for something completely different<br />
<br />
When two black holes merge, the newly formed black hole is distorted. It settles towards a stationary state by emitting gravitational waves in a process called <span style="font-weight: bold;" class="mycode_b">ringdown</span>. Like a struck bell, it oscillates with a signal that fades away. These oscillations are described by quasinormal modes; their frequencies and decay times depend on the final black hole’s mass and spin. You can watch spacetime doing its final ringing in <a href="https://svs.gsfc.nasa.gov/13197" target="_blank" rel="noopener" class="mycode_url">this NASA simulation</a>.<br />
<br />
We started Python 3.10 with <a href="https://blog.python.org/2021/10/python-3100-is-available/" target="_blank" rel="noopener" class="mycode_url">a trip inside a Schwarzschild black hole</a>, so it seems only fair to finish with black holes as well :)<br />
<br />
This is Python 3.10’s ringdown. One last release before we switch off the release machinery. Five years of features, fixes, stubborn buildbots, and a rather unreasonable number of tarballs. I cannot quite believe I am writing the last one.<br />
<br />
Thank you to everyone who contributed patches, reviewed changes, tested releases, reported bugs, or helped us get a release out when the universe seemed determined to prevent it. It has been a privilege to be your release manager for this series.<br />
<br />
Python 3.11 still has another year of security fixes ahead of it, so you have not escaped me yet :)<br />
<br />
We hope you enjoy the new releases!<br />
<br />
Thank you to all the volunteers who made these releases possible. Please consider supporting Python by contributing your time or through the <a href="https://www.python.org/psf-landing/" target="_blank" rel="noopener" class="mycode_url">Python Software Foundation</a>.<br />
<br />
Your friendly release team,<br />
<br />
<a href="https://discuss.python.org/u/hugovk" target="_blank" rel="noopener" class="mycode_url">Hugo van Kemenade</a><br />
<br />
<a href="https://discuss.python.org/u/thomas" target="_blank" rel="noopener" class="mycode_url">Thomas Wouters</a><br />
<br />
<a href="https://discuss.python.org/u/pablogsal" target="_blank" rel="noopener" class="mycode_url">Pablo Galindo Salgado</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Python Language Summit 2026]]></title>
			<link>https://sickgaming.net/thread-113573.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:11 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113573.html</guid>
			<description><![CDATA[On July 14th, 2026, 47 Python core developers and special guests sat down<br />
at the <a href="https://ep2026.europython.eu/language-summit/" target="_blank" rel="noopener" class="mycode_url">Python Language Summit</a>, this year<br />
held in Kraków, Poland at EuroPython 2026, to discuss many topics about the future<br />
of the Python programming language, including free-threading, Rust, garbage collectors,<br />
type annotations, and namespacing.<br />
<br />
<img src="https://blog.python.org/_astro/image.CI8AChx-_ZOy8Ro.webp" loading="lazy"  alt="[Image: image.CI8AChx-_ZOy8Ro.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55516581426/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
This marked the first time the Python Language<br />
Summit had been hosted in Europe since 2011, when the event was<br />
<a href="https://lwn.net/Articles/449710/" target="_blank" rel="noopener" class="mycode_url">held in Florence on June 19th, 2011</a>.<br />
Going forward, the Python Language Summit will alternate between<br />
PyCon US and EuroPython on a yearly basis.<br />
<br />
The summit was organized by Emily Morehouse, Hugo van Kemenade, Lysandros Nikolaou,<br />
and Łukasz Langa, and blog posts were written by Seth Larson.<br />
<br />
Below are summaries of the 10 full-length<br />
talks and 5 lightning talks that were presented at the 2026 Python Language Summit.<br />
I hope you enjoy them, and thank you for your patience.<br />
<ul class="mycode_list"><li>“<a href="https://blog.python.org/2026/09/language-summit-2026-namespaces" target="_blank" rel="noopener" class="mycode_url">One namespace to namespace them all</a>” by Pablo Galindo Salgado<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-macos-python" target="_blank" rel="noopener" class="mycode_url">macOS and Python</a>” by Ned Deily<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-garbage-collection-generational-incremental-both" target="_blank" rel="noopener" class="mycode_url">Garbage Collection: Generational? Incremental? Both!</a>” by Mark Shannon<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-memory-buffer-protocol" target="_blank" rel="noopener" class="mycode_url">Memory Buffer Protocol</a>” by Nathan Goldbaum<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-memory-snapshots" target="_blank" rel="noopener" class="mycode_url">Memory Snapshots for CPython</a>” by Hood Chatham<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-rust-for-cpython" target="_blank" rel="noopener" class="mycode_url">Rust for CPython</a>” by David Hewitt<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-spicycrab" target="_blank" rel="noopener" class="mycode_url">Spicycrab</a>” by Kushal Das<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-developer-in-residence-update-and-future" target="_blank" rel="noopener" class="mycode_url">Developer-in-Residence Update & Future</a>” by Petr Viktorin<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-free-threading-post-era" target="_blank" rel="noopener" class="mycode_url">Free-Threaded Python Post-Era</a>” by Donghee Na, Tobias Wrigstad, and Fridtjof Stoldt<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-pep-827-type-manipulation" target="_blank" rel="noopener" class="mycode_url">PEP 827: Type Manipulation</a>” by Michael J. Sullivan<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-lightning-talks" target="_blank" rel="noopener" class="mycode_url">Lightning Talks</a>”<ul class="mycode_list"><li>“One-time ABI breakage” by Mark Shannon<br />
<br />
</li>
<li>“Safer and Generic Interruptions” by Daniele Parmeggiani<br />
<br />
</li>
<li>“EktuPy, Scratch but Python” by Kushal Das<br />
<br />
</li>
<li>“<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> for CPython” by Gregory P. Smith and Łukasz Langa<br />
<br />
</li>
<li>“Please read PEP 836 (JIT go brrr)” by Ken Jin<br />
<br />
</li>
</ul>
<br />
</li>
</ul>
]]></description>
			<content:encoded><![CDATA[On July 14th, 2026, 47 Python core developers and special guests sat down<br />
at the <a href="https://ep2026.europython.eu/language-summit/" target="_blank" rel="noopener" class="mycode_url">Python Language Summit</a>, this year<br />
held in Kraków, Poland at EuroPython 2026, to discuss many topics about the future<br />
of the Python programming language, including free-threading, Rust, garbage collectors,<br />
type annotations, and namespacing.<br />
<br />
<img src="https://blog.python.org/_astro/image.CI8AChx-_ZOy8Ro.webp" loading="lazy"  alt="[Image: image.CI8AChx-_ZOy8Ro.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55516581426/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
This marked the first time the Python Language<br />
Summit had been hosted in Europe since 2011, when the event was<br />
<a href="https://lwn.net/Articles/449710/" target="_blank" rel="noopener" class="mycode_url">held in Florence on June 19th, 2011</a>.<br />
Going forward, the Python Language Summit will alternate between<br />
PyCon US and EuroPython on a yearly basis.<br />
<br />
The summit was organized by Emily Morehouse, Hugo van Kemenade, Lysandros Nikolaou,<br />
and Łukasz Langa, and blog posts were written by Seth Larson.<br />
<br />
Below are summaries of the 10 full-length<br />
talks and 5 lightning talks that were presented at the 2026 Python Language Summit.<br />
I hope you enjoy them, and thank you for your patience.<br />
<ul class="mycode_list"><li>“<a href="https://blog.python.org/2026/09/language-summit-2026-namespaces" target="_blank" rel="noopener" class="mycode_url">One namespace to namespace them all</a>” by Pablo Galindo Salgado<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-macos-python" target="_blank" rel="noopener" class="mycode_url">macOS and Python</a>” by Ned Deily<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-garbage-collection-generational-incremental-both" target="_blank" rel="noopener" class="mycode_url">Garbage Collection: Generational? Incremental? Both!</a>” by Mark Shannon<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-memory-buffer-protocol" target="_blank" rel="noopener" class="mycode_url">Memory Buffer Protocol</a>” by Nathan Goldbaum<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-memory-snapshots" target="_blank" rel="noopener" class="mycode_url">Memory Snapshots for CPython</a>” by Hood Chatham<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-rust-for-cpython" target="_blank" rel="noopener" class="mycode_url">Rust for CPython</a>” by David Hewitt<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-spicycrab" target="_blank" rel="noopener" class="mycode_url">Spicycrab</a>” by Kushal Das<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-developer-in-residence-update-and-future" target="_blank" rel="noopener" class="mycode_url">Developer-in-Residence Update & Future</a>” by Petr Viktorin<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-free-threading-post-era" target="_blank" rel="noopener" class="mycode_url">Free-Threaded Python Post-Era</a>” by Donghee Na, Tobias Wrigstad, and Fridtjof Stoldt<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-pep-827-type-manipulation" target="_blank" rel="noopener" class="mycode_url">PEP 827: Type Manipulation</a>” by Michael J. Sullivan<br />
<br />
</li>
<li>“<a href="https://blog.python.org/2026/09/language-summit-2026-lightning-talks" target="_blank" rel="noopener" class="mycode_url">Lightning Talks</a>”<ul class="mycode_list"><li>“One-time ABI breakage” by Mark Shannon<br />
<br />
</li>
<li>“Safer and Generic Interruptions” by Daniele Parmeggiani<br />
<br />
</li>
<li>“EktuPy, Scratch but Python” by Kushal Das<br />
<br />
</li>
<li>“<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> for CPython” by Gregory P. Smith and Łukasz Langa<br />
<br />
</li>
<li>“Please read PEP 836 (JIT go brrr)” by Ken Jin<br />
<br />
</li>
</ul>
<br />
</li>
</ul>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Lightning Talks (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113567.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:10 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113567.html</guid>
			<description><![CDATA[One-time ABI breakage<br />
<br />
By Mark Shannon<br />
<br />
<img src="https://blog.python.org/_astro/mark.BOgwwffu_Z37b3J.webp" loading="lazy"  alt="[Image: mark.BOgwwffu_Z37b3J.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Why break the <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a>? Because there are 32 spare bits in the<br />
<a href="https://docs.python.org/3/c-api/structures.html#c.PyObject" target="_blank" rel="noopener" class="mycode_url">PyObject</a> header that we currently can’t use.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]struct _object {
    Py_ssize_t ob_refcnt;  // Mark wants the high bits in this struct.
    PyTypeObject *ob_type;
};[/code]</code></div></div><br />
Since <a href="https://peps.python.org/pep-0683/" target="_blank" rel="noopener" class="mycode_url">PEP 683</a> was accepted in Python 3.12,<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ob_refcnt</code></div></div> has effectively been treated as a 32-bit integer, but these<br />
bits are still inaccessible for other uses to prevent breakages.<br />
If the Python core team could repurpose these<br />
bits, Mark could implement a better garbage collector and faster allocations.<br />
<br />
Breaking the Stable ABI would be “easy to do… probably not painless though”,<br />
in reference to users needing to port, recompile, and support multiple ABIs.<br />
<br />
“Well… it’s going to happen anyway”, Mark said, referencing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div> for<br />
<a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threading</a>,<br />
and how Python packages depending on the Stable ABI would need to move to the<br />
new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div> ABI.<br />
<br />
Thomas Wouters provided an answer: wait until there is only a single Stable ABI, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div>.<br />
Free-threaded Python has not promised Stable ABI compatibility<br />
for its object layout, unlike non-free-threaded Python, which exposed<br />
details about <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ob_refcnt</code></div></div> in the Stable ABI.<br />
<br />
It was at this point that it began slowly dawning on Mark, to his horror, that free-threaded<br />
Python may be solving his problem. After free-threading becomes the new Python default,<br />
the Stable ABI that exposes the object header internals will be no more, and Mark<br />
and team can make changes to the object header more freely. We’ll just have to be patient!<br />
<br />
Safer and Generic Interruptions<br />
<br />
By Daniele Parmeggiani<br />
<br />
<img src="https://blog.python.org/_astro/daniele.Bf3aBw4B_1lxu9U.webp" loading="lazy"  alt="[Image: daniele.Bf3aBw4B_1lxu9U.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Daniele presented a gap in implementing structured concurrency with threads in Python today:<br />
the inability to safely interrupt tasks that failed or have been cancelled.<br />
<br />
For example, let’s say there were two<br />
I/O-bound parallel database queries sent as a result of a web request (task A and task B). If task A returned early with<br />
an error, the result of task B would no longer be needed, because an exception would be raised anyway.<br />
However, right now there is no way to cancel task B, so instead the result of task B is waited for<br />
and then thrown away before propagating the exception from task A.<br />
<br />
Interrupts are one way to implement this cancellation mechanism.<br />
Daniele explained that the machinery to implement cancellations via interrupts is “already available in CPython,<br />
but isn’t exposed at the Python level”. And why isn’t this functionality exposed? Because it’s a huge source of “footguns”.<br />
<br />
Instead of exposing the unsafe functionality directly, Daniele would like to offer users<br />
a way to handle interruptions safely. To do this, Daniele proposes adding uninterruptible scopes,<br />
where a <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" target="_blank" rel="noopener" class="mycode_url">context manager’s</a> <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__enter__()</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__exit__()</code></div></div> methods are<br />
“shielded” from being interrupted and are guaranteed to execute.<br />
<br />
“You can’t really rely on &#91;context manager cleanups&#93; with interruptions right now”.<br />
If you read the documentation of the <a href="https://docs.python.org/3/library/signal.html#note-on-signal-handlers-and-exceptions" target="_blank" rel="noopener" class="mycode_url">signal module</a>,<br />
it tells you to turn off signals because they aren’t safe. “It’s a bit weird that the documentation for signals says that”.<br />
<br />
“Is this good for performance? No, it adds more bytecode”, Daniele said, closing his presentation, “but<br />
I’ve made sure to make Mark Shannon happy”. Daniele invited anyone who is interested<br />
in an implementation of this functionality to contact him.<br />
<br />
EktuPy, Scratch but Python<br />
<br />
By Kushal Das<br />
<br />
<img src="https://blog.python.org/_astro/kushal.CfsMn3X6_Zh68J5.webp" loading="lazy"  alt="[Image: kushal.CfsMn3X6_Zh68J5.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Kushal Das brought a short presentation on a project he’d been working on to teach Python to the generation of young programmers who learned using Scratch. <a href="https://scratch.mit.edu/" target="_blank" rel="noopener" class="mycode_url">Scratch</a> is a programming language that is represented using blocks instead of text to create animations, games, and other media-focused programs.<br />
<br />
<a href="https://ektupy.org" target="_blank" rel="noopener" class="mycode_url">EktuPy</a> brings many of the features that are beloved in Scratch, such as the focus on media like games and animations, and the “remix” concept to give new programmers a working base to start with instead of a daunting blank canvas. EktuPy tries to bridge the gap between block-based programming languages and text-based languages like Python.<br />
<br />
AGENTS.md for CPython<br />
<br />
By Gregory P. Smith and Łukasz Langa<br />
<br />
<img src="https://blog.python.org/_astro/lukasz-greg.DnZnBvF0_167otO.webp" loading="lazy"  alt="[Image: lukasz-greg.DnZnBvF0_167otO.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
CPython, just like many other open source projects, has been seeing many contributions from folks using LLM agents. Gregory P. Smith and Łukasz Langa wanted to get a “vibe check” from core developers about adding a simple <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> file to the CPython repository. The hope was that even basic guidance about how to contribute to CPython (such as linking to the <a href="https://devguide.python.org/" target="_blank" rel="noopener" class="mycode_url">Developer Guide</a>) would improve the quality of the large number of pull requests made using agents.<br />
<br />
Greg asked for a show of hands for “who would be against adding an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> to the repository”, and no core developer hands were raised. “Oh, that was easier than I thought”. Thomas Wouters remarked that he “wished it wasn’t necessary” to have an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div>.<br />
<br />
Another issue raised was that <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> files tend to receive many outside contributions from people wanting to add new things. Greg made it clear that the file would be kept very simple and “seldom change”, suggesting that the core team would “reject pull requests that modify the file”.<br />
<br />
Seth Larson asked about quantifying the improvement to contributions, citing that the Python Security Response Team had seen increased volumes of LLM-generated reports. Changes to the <a href="https://www.python.org/dev/security/" target="_blank" rel="noopener" class="mycode_url">security policy</a> and adding a threat model appeared to work, but this was difficult to prove.<br />
<br />
Łukasz shared his pessimistic view that CPython would someday have to stop accepting many outside contributions due to the large number of agent-driven contributions.<br />
<br />
Please read PEP 836 (JIT go brrr)<br />
<br />
By Ken Jin<br />
<br />
Closing out the Language Summit lightning talks, Ken Jin had a simple request: to <a href="https://peps.python.org/pep-0836/" target="_blank" rel="noopener" class="mycode_url">please read PEP 836</a>. Ken had <a href="https://discuss.python.org/t/pep-836-jit-go-brrr-the-path-to-a-supported-jit-compiler-for-cpython/108010" target="_blank" rel="noopener" class="mycode_url">only received 33 replies on the PEP discussion thread for PEP 836</a>, and encouraged core developers (and anyone reading this blog post) to read the PEP and “tell us what you disagree with”.]]></description>
			<content:encoded><![CDATA[One-time ABI breakage<br />
<br />
By Mark Shannon<br />
<br />
<img src="https://blog.python.org/_astro/mark.BOgwwffu_Z37b3J.webp" loading="lazy"  alt="[Image: mark.BOgwwffu_Z37b3J.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Why break the <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a>? Because there are 32 spare bits in the<br />
<a href="https://docs.python.org/3/c-api/structures.html#c.PyObject" target="_blank" rel="noopener" class="mycode_url">PyObject</a> header that we currently can’t use.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]struct _object {
    Py_ssize_t ob_refcnt;  // Mark wants the high bits in this struct.
    PyTypeObject *ob_type;
};[/code]</code></div></div><br />
Since <a href="https://peps.python.org/pep-0683/" target="_blank" rel="noopener" class="mycode_url">PEP 683</a> was accepted in Python 3.12,<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ob_refcnt</code></div></div> has effectively been treated as a 32-bit integer, but these<br />
bits are still inaccessible for other uses to prevent breakages.<br />
If the Python core team could repurpose these<br />
bits, Mark could implement a better garbage collector and faster allocations.<br />
<br />
Breaking the Stable ABI would be “easy to do… probably not painless though”,<br />
in reference to users needing to port, recompile, and support multiple ABIs.<br />
<br />
“Well… it’s going to happen anyway”, Mark said, referencing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div> for<br />
<a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threading</a>,<br />
and how Python packages depending on the Stable ABI would need to move to the<br />
new <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div> ABI.<br />
<br />
Thomas Wouters provided an answer: wait until there is only a single Stable ABI, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>abi3t</code></div></div>.<br />
Free-threaded Python has not promised Stable ABI compatibility<br />
for its object layout, unlike non-free-threaded Python, which exposed<br />
details about <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ob_refcnt</code></div></div> in the Stable ABI.<br />
<br />
It was at this point that it began slowly dawning on Mark, to his horror, that free-threaded<br />
Python may be solving his problem. After free-threading becomes the new Python default,<br />
the Stable ABI that exposes the object header internals will be no more, and Mark<br />
and team can make changes to the object header more freely. We’ll just have to be patient!<br />
<br />
Safer and Generic Interruptions<br />
<br />
By Daniele Parmeggiani<br />
<br />
<img src="https://blog.python.org/_astro/daniele.Bf3aBw4B_1lxu9U.webp" loading="lazy"  alt="[Image: daniele.Bf3aBw4B_1lxu9U.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Daniele presented a gap in implementing structured concurrency with threads in Python today:<br />
the inability to safely interrupt tasks that failed or have been cancelled.<br />
<br />
For example, let’s say there were two<br />
I/O-bound parallel database queries sent as a result of a web request (task A and task B). If task A returned early with<br />
an error, the result of task B would no longer be needed, because an exception would be raised anyway.<br />
However, right now there is no way to cancel task B, so instead the result of task B is waited for<br />
and then thrown away before propagating the exception from task A.<br />
<br />
Interrupts are one way to implement this cancellation mechanism.<br />
Daniele explained that the machinery to implement cancellations via interrupts is “already available in CPython,<br />
but isn’t exposed at the Python level”. And why isn’t this functionality exposed? Because it’s a huge source of “footguns”.<br />
<br />
Instead of exposing the unsafe functionality directly, Daniele would like to offer users<br />
a way to handle interruptions safely. To do this, Daniele proposes adding uninterruptible scopes,<br />
where a <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" target="_blank" rel="noopener" class="mycode_url">context manager’s</a> <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__enter__()</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__exit__()</code></div></div> methods are<br />
“shielded” from being interrupted and are guaranteed to execute.<br />
<br />
“You can’t really rely on &#91;context manager cleanups&#93; with interruptions right now”.<br />
If you read the documentation of the <a href="https://docs.python.org/3/library/signal.html#note-on-signal-handlers-and-exceptions" target="_blank" rel="noopener" class="mycode_url">signal module</a>,<br />
it tells you to turn off signals because they aren’t safe. “It’s a bit weird that the documentation for signals says that”.<br />
<br />
“Is this good for performance? No, it adds more bytecode”, Daniele said, closing his presentation, “but<br />
I’ve made sure to make Mark Shannon happy”. Daniele invited anyone who is interested<br />
in an implementation of this functionality to contact him.<br />
<br />
EktuPy, Scratch but Python<br />
<br />
By Kushal Das<br />
<br />
<img src="https://blog.python.org/_astro/kushal.CfsMn3X6_Zh68J5.webp" loading="lazy"  alt="[Image: kushal.CfsMn3X6_Zh68J5.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Kushal Das brought a short presentation on a project he’d been working on to teach Python to the generation of young programmers who learned using Scratch. <a href="https://scratch.mit.edu/" target="_blank" rel="noopener" class="mycode_url">Scratch</a> is a programming language that is represented using blocks instead of text to create animations, games, and other media-focused programs.<br />
<br />
<a href="https://ektupy.org" target="_blank" rel="noopener" class="mycode_url">EktuPy</a> brings many of the features that are beloved in Scratch, such as the focus on media like games and animations, and the “remix” concept to give new programmers a working base to start with instead of a daunting blank canvas. EktuPy tries to bridge the gap between block-based programming languages and text-based languages like Python.<br />
<br />
AGENTS.md for CPython<br />
<br />
By Gregory P. Smith and Łukasz Langa<br />
<br />
<img src="https://blog.python.org/_astro/lukasz-greg.DnZnBvF0_167otO.webp" loading="lazy"  alt="[Image: lukasz-greg.DnZnBvF0_167otO.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
CPython, just like many other open source projects, has been seeing many contributions from folks using LLM agents. Gregory P. Smith and Łukasz Langa wanted to get a “vibe check” from core developers about adding a simple <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> file to the CPython repository. The hope was that even basic guidance about how to contribute to CPython (such as linking to the <a href="https://devguide.python.org/" target="_blank" rel="noopener" class="mycode_url">Developer Guide</a>) would improve the quality of the large number of pull requests made using agents.<br />
<br />
Greg asked for a show of hands for “who would be against adding an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> to the repository”, and no core developer hands were raised. “Oh, that was easier than I thought”. Thomas Wouters remarked that he “wished it wasn’t necessary” to have an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div>.<br />
<br />
Another issue raised was that <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div> files tend to receive many outside contributions from people wanting to add new things. Greg made it clear that the file would be kept very simple and “seldom change”, suggesting that the core team would “reject pull requests that modify the file”.<br />
<br />
Seth Larson asked about quantifying the improvement to contributions, citing that the Python Security Response Team had seen increased volumes of LLM-generated reports. Changes to the <a href="https://www.python.org/dev/security/" target="_blank" rel="noopener" class="mycode_url">security policy</a> and adding a threat model appeared to work, but this was difficult to prove.<br />
<br />
Łukasz shared his pessimistic view that CPython would someday have to stop accepting many outside contributions due to the large number of agent-driven contributions.<br />
<br />
Please read PEP 836 (JIT go brrr)<br />
<br />
By Ken Jin<br />
<br />
Closing out the Language Summit lightning talks, Ken Jin had a simple request: to <a href="https://peps.python.org/pep-0836/" target="_blank" rel="noopener" class="mycode_url">please read PEP 836</a>. Ken had <a href="https://discuss.python.org/t/pep-836-jit-go-brrr-the-path-to-a-supported-jit-compiler-for-cpython/108010" target="_blank" rel="noopener" class="mycode_url">only received 33 replies on the PEP discussion thread for PEP 836</a>, and encouraged core developers (and anyone reading this blog post) to read the PEP and “tell us what you disagree with”.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] PEP 827: Type Manipulation (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113485.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:09 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113485.html</guid>
			<description><![CDATA[Michael J. Sullivan came to the Language Summit to discuss <a href="https://peps.python.org/pep-0827/" target="_blank" rel="noopener" class="mycode_url">PEP 827</a>, a PEP that includes many proposed improvements to Python type annotations. For the Python Language Summit, Michael wanted to focus in particular on one aspect: how type annotations are stored.<br />
<br />
<img src="https://blog.python.org/_astro/michael.-hvbrYNP_1gfrzS.webp" loading="lazy"  alt="[Image: michael.-hvbrYNP_1gfrzS.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Michael began by introducing PEP 827 “by looking at a completely different programming language”. He brought up an example from <a href="https://github.com/prisma/orm" target="_blank" rel="noopener" class="mycode_url">Prisma</a>, an object-relational mapper (ORM) library written in <a href="https://www.typescriptlang.org/docs/" target="_blank" rel="noopener" class="mycode_url">TypeScript</a>. Calling<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>findMany</code></div></div> on a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>User</code></div></div> model infers a return type based on the input parameters’ values, such as when selecting a subset of fields:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]const user = await prisma.user.findMany({
  select: {
    name: true,
    email: true,
    posts: true,
  },
});[/code]</code></div></div><br />
This query derives a type that looks like this in TypeScript:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]{
  email: string;
  name: string | null;
  posts: {
    id: number;
    title: string;
    content: string | null;
    authorId: number | null;
  }&#91;&#93;;
}&#91;&#93;[/code]</code></div></div><br />
With PEP 827, Python’s type annotations could work similarly. Return types<br />
could be inferred from a function’s input parameter types.<br />
<br />
Another use-case PEP 827 serves is generating new types programmatically, such as for CRUD (Create, Read, Update, Delete) web applications, where a single database table typically has a separate ORM model definition for each CRUD operation. Create would require all properties without defaults, Read would include all the public properties of a model, and Update would make all properties optional (supporting the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PATCH</code></div></div> HTTP method). Delete doesn’t typically need a model, as only the primary key is needed to delete a record.<br />
<br />
The example given in PEP 827 uses a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Hero</code></div></div> model, which has a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>secret_name</code></div></div> and an optional <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>age</code></div></div> parameter, and creates three other models for the “public get”, create, and update operations:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]class HeroBase(SQLModel):
    name: str = Field(index=True)
    age: int | None = Field(default=None, index=True)

class Hero(HeroBase, table=True):
    id: int | None = Field(default=None, primary_key=True)
    secret_name: str

class HeroPublic(HeroBase):
    id: int

class HeroCreate(HeroBase):
    secret_name: str

class HeroUpdate(HeroBase):
    name: str | None = None
    age: int | None = None
    secret_name: str | None = None[/code]</code></div></div><br />
Keeping all of these models and parameters up-to-date with the database model requires lots of diligence and can’t usually be done programmatically. So what if there was a way to instead contain the complexity within a type that transforms the overall model type for each of the CRUD operations? PEP 827 would allow writing Python types like the example below, containing the complexity in the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Public</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Create</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Update</code></div></div> annotations:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]class Hero(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    name: str = Field(index=True)
    age: int | None = Field(default=None, index=True)
    secret_name: str = Field(hidden=True)

type HeroPublic = Public&#91;Hero&#93;
type HeroCreate = Create&#91;Hero&#93;
type HeroUpdate = Update&#91;Hero&#93;[/code]</code></div></div><br />
Type manipulation primitives in PEP 827<br />
<br />
The core of the idea is introducing a handful of primitives to Python’s type system:<br />
<ul class="mycode_list"><li>Conditional types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>true_type if bool_type else false_type</code></div></div>).<br />
<br />
</li>
<li>Comprehension types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>*&#91;t for t in Iter&#91;iter_t&#93;&#93;</code></div></div>). Comprehension types can have conditional <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>if</code></div></div> clauses, just like regular comprehensions.<br />
<br />
</li>
<li>Member types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typing.Members&#91;t&#93;</code></div></div> would return an iterable of the type’s members). <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>member.name</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>member.type</code></div></div> would be properties of the member.<br />
<br />
</li>
</ul>
<br />
The PEP was “inspired by TypeScript, but importantly &#91;the PEP&#93; is not modeled after TypeScript”. Michael noted that Python and JavaScript are “very different languages”, so the system ended up looking “quite a bit different”. The PEP was also designed so that no new keywords would be required to adopt it.<br />
<br />
PEP 827 contains many other proposed features that Michael didn’t have time to cover, including new operators, callable special construction, tuple slicing and length, iterating over unions, getting types of an attribute, inspecting initializers, and ways to handle <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__init_subclass__</code></div></div> decorators. The PEP contains a <a href="https://github.com/msullivan/mypy-typemap/tree/typemap" target="_blank" rel="noopener" class="mycode_url">mypy-based prototype</a> for all the features being proposed.<br />
<br />
How to store type annotations?<br />
<br />
Having introduced the PEP, Michael then returned to his original motivation: discussing how to store type annotations for runtime use. Popular libraries like <a href="https://docs.pydantic.dev/" target="_blank" rel="noopener" class="mycode_url">Pydantic</a> and <a href="https://fastapi.tiangolo.com/" target="_blank" rel="noopener" class="mycode_url">FastAPI</a> use type annotations at runtime to drive their behavior. “This was complicated by our desire to use Python-y syntax”, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>if</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>for</code></div></div>, and dot notation.<br />
In concrete terms, Python will itself <span style="font-style: italic;" class="mycode_i">evaluate</span> the types at runtime. In order to implement everything in PEP 827, there would need to be a way to access the <span style="font-style: italic;" class="mycode_i">unevaluated</span> type even after Python had<br />
executed the conditionals or iterations. As currently drafted, “the PEP is carefully designed to support an evaluator that works by calling the <a href="https://docs.python.org/3/reference/datamodel.html#object.__annotate__" target="_blank" rel="noopener" class="mycode_url">__annotate__()</a> functions”.<br />
<br />
There’s already a module, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib</code></div></div>, which has a “string format” (<a href="https://docs.python.org/3/library/annotationlib.html#annotationlib.Format.STRING" target="_blank" rel="noopener" class="mycode_url">Format.STRING</a>). In theory, if you call <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib.get_annotations(..., format=Format.STRING)</code></div></div>, then you’d get the type annotation back unevaluated. “But this isn’t how this function is implemented today”; instead, the function does “dreadfully clever stuff” using proxy objects that overload every dunder method.<br />
<br />
Imogen Hergeth has <a href="https://peps.python.org/pep-0849/" target="_blank" rel="noopener" class="mycode_url">drafted PEP 849 proposing a new “AST” format</a> that is related to this problem, but Michael thought it would be smaller and more straightforward to make the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> format work with conditional expressions. “There’s a surprisingly large design space here with trade-offs between time, space, and complexity”.<br />
<br />
One of the original ideas considered by the PEP that moved to <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> functions was “can we just store the strings?” The most straightforward option would be for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> to support <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> in addition to <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>VALUE</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>VALUE_WITH_FAKE_GLOBALS</code></div></div>. The <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> function would get a little bigger, but if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> is passed as the format, it would return the strings “instead of requiring the library to do something complicated to get there”.<br />
<br />
This approach is fast, but uses more memory by representing annotations redundantly. The team considered whether to do the “even more obvious thing” and evaluated storing <span style="font-style: italic;" class="mycode_i">only the strings</span>. But this isn’t enough; type annotations can refer to local variables, so evaluating them requires more context. “This is the whole reason we moved away from <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>from __future__ import annotations</code></div></div> (<a href="https://peps.python.org/pep-0563/" target="_blank" rel="noopener" class="mycode_url">PEP 563</a>), did <a href="https://peps.python.org/pep-0649/" target="_blank" rel="noopener" class="mycode_url">PEP 649</a>, and added complexity to generating <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div> functions”.<br />
<br />
Michael detailed a proposed alternate approach that saves memory at the expense of computation speed: “If we have the string for a type annotation, and we have the environment closure for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div>, then we can <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>eval()</code></div></div> the string in that closure and it will work. What would that look like?<br />
Generate an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div> function that only implements the format for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div>, but is set up to only contain the free variables that the annotation used. If the type annotation refers to local<br />
variables, the annotation will still depend on &#91;the variables&#93;, &#91;the type annotation&#93; wouldn’t directly do anything with &#91;the variables&#93;. &#91;The type annotation&#93; would just build the dictionary with the strings.<br />
We’d have a function in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib</code></div></div> that knows<br />
how to pull &#91;the variables&#93; out, combine that with the strings, and evaluate them &#91;both&#93; properly. We could make <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> call that &#91;annotationlib&#93; function when you ask for an evaluated type annotation”.<br />
This approach would use a lot less memory than using strings, but would be much slower because you’d need to use <a href="https://docs.python.org/3/library/functions.html#eval" target="_blank" rel="noopener" class="mycode_url">eval()</a>.<br />
<br />
Discussion<br />
<br />
Stefan Behnel asked whether accepting PEP 827 would make the type system Turing-complete with the proposed conditionals and comprehensions. Michael replied that the Python type system “is already Turing-complete, but only <span style="font-style: italic;" class="mycode_i">accidentally</span> Turing-complete”. Java had run into this issue with generics with subtyping bounds, and “Python does the same Generic stuff as Java”. “There was never an intention for the type system to be Turing-complete”, therefore accepting PEP 827 would only change the type system to be “intentionally Turing-complete”.<br />
<br />
<img src="https://blog.python.org/_astro/lukasz.BGVjyFf-_1NeITT.webp" loading="lazy"  alt="[Image: lukasz.BGVjyFf-_1NeITT.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Łukasz Langa commented on the aesthetics of the proposed syntax, pointing out the example of the comprehensions with “stars”. He cautioned core developers against seeing this syntax and having a knee-jerk negative reaction, such as thinking: “Oh &#91;f-string&#93;, they’re going to make type hints look even worse”. Łukasz was clear that “…these features are for &#91;frameworks&#93; to implement internally &#91;features&#93; that allow type checkers to magically generate the correct types”. “Users are not meant to write types like these or only use them very rarely”.<br />
<br />
Łukasz also commented on the performance of using strings: when he first wrote <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>from __future__ import annotations</code></div></div>, one of the motivations was that strings are “<a href="https://docs.python.org/3/library/sys.html#sys.intern" target="_blank" rel="noopener" class="mycode_url">interned</a>”. Using string interning for types would take “less memory”. The problem was that the alphabet for interning strings doesn’t allow for square brackets (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#91;&#93;</code></div></div>), which are used often in Python type annotations. There was a question whether this could be changed in Python, to which Łukasz replied that “we could, but then we ruin Python for everybody else” because this behavior has been “relied on for over 30 years”. “However…”, Łukasz continued, “what if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> interned &#91;strings&#93; all the time?” We expect many type annotations to be the same or similar, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>None</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>str</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>str | None</code></div></div>. Łukasz suggested that this method “wouldn’t cost much memory”, which Michael agreed with.<br />
<br />
David Hewitt shared his experience working with TypeScript, where there are very complicated types. “When you’re a TypeScript user and you’re trying to figure out an API, you start clicking down through the API layers”, and you often hit the issue (“as Łukasz described”, with an accompanying “oh &#91;f-string&#93;”). David was concerned about whether this new syntax would be something that users would encounter frequently.<br />
<br />
Michael confessed that users clicking into “the select method” on an ORM would “see a wild type” and “there’s no getting around that”. “…but hopefully they’ll see the docstring first. If they look at the return type they’ll see something nice”. “I think there are cases where you’re doing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>select(User)</code></div></div> you might be able to populate specific properties”, but this would be “potentially finicky” and dependent on the language server being used.<br />
<br />
<img src="https://blog.python.org/_astro/yury.DW7jflfY_rh2R8.webp" loading="lazy"  alt="[Image: yury.DW7jflfY_rh2R8.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
“There will be moments where users discover that the world is complex”, Yury Selivanov, a co-author of the PEP, said, acknowledging the need for complex type annotations. “Right now the world is not typed”. “The Python type system does not match the expressiveness of the language”. “Certainly some people might be confused”, he added, listing a few ways to mitigate this issue, such as better IDEs, language servers, and documentation.]]></description>
			<content:encoded><![CDATA[Michael J. Sullivan came to the Language Summit to discuss <a href="https://peps.python.org/pep-0827/" target="_blank" rel="noopener" class="mycode_url">PEP 827</a>, a PEP that includes many proposed improvements to Python type annotations. For the Python Language Summit, Michael wanted to focus in particular on one aspect: how type annotations are stored.<br />
<br />
<img src="https://blog.python.org/_astro/michael.-hvbrYNP_1gfrzS.webp" loading="lazy"  alt="[Image: michael.-hvbrYNP_1gfrzS.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Michael began by introducing PEP 827 “by looking at a completely different programming language”. He brought up an example from <a href="https://github.com/prisma/orm" target="_blank" rel="noopener" class="mycode_url">Prisma</a>, an object-relational mapper (ORM) library written in <a href="https://www.typescriptlang.org/docs/" target="_blank" rel="noopener" class="mycode_url">TypeScript</a>. Calling<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>findMany</code></div></div> on a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>User</code></div></div> model infers a return type based on the input parameters’ values, such as when selecting a subset of fields:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]const user = await prisma.user.findMany({
  select: {
    name: true,
    email: true,
    posts: true,
  },
});[/code]</code></div></div><br />
This query derives a type that looks like this in TypeScript:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]{
  email: string;
  name: string | null;
  posts: {
    id: number;
    title: string;
    content: string | null;
    authorId: number | null;
  }&#91;&#93;;
}&#91;&#93;[/code]</code></div></div><br />
With PEP 827, Python’s type annotations could work similarly. Return types<br />
could be inferred from a function’s input parameter types.<br />
<br />
Another use-case PEP 827 serves is generating new types programmatically, such as for CRUD (Create, Read, Update, Delete) web applications, where a single database table typically has a separate ORM model definition for each CRUD operation. Create would require all properties without defaults, Read would include all the public properties of a model, and Update would make all properties optional (supporting the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PATCH</code></div></div> HTTP method). Delete doesn’t typically need a model, as only the primary key is needed to delete a record.<br />
<br />
The example given in PEP 827 uses a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Hero</code></div></div> model, which has a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>secret_name</code></div></div> and an optional <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>age</code></div></div> parameter, and creates three other models for the “public get”, create, and update operations:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]class HeroBase(SQLModel):
    name: str = Field(index=True)
    age: int | None = Field(default=None, index=True)

class Hero(HeroBase, table=True):
    id: int | None = Field(default=None, primary_key=True)
    secret_name: str

class HeroPublic(HeroBase):
    id: int

class HeroCreate(HeroBase):
    secret_name: str

class HeroUpdate(HeroBase):
    name: str | None = None
    age: int | None = None
    secret_name: str | None = None[/code]</code></div></div><br />
Keeping all of these models and parameters up-to-date with the database model requires lots of diligence and can’t usually be done programmatically. So what if there was a way to instead contain the complexity within a type that transforms the overall model type for each of the CRUD operations? PEP 827 would allow writing Python types like the example below, containing the complexity in the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Public</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Create</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Update</code></div></div> annotations:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]class Hero(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    name: str = Field(index=True)
    age: int | None = Field(default=None, index=True)
    secret_name: str = Field(hidden=True)

type HeroPublic = Public&#91;Hero&#93;
type HeroCreate = Create&#91;Hero&#93;
type HeroUpdate = Update&#91;Hero&#93;[/code]</code></div></div><br />
Type manipulation primitives in PEP 827<br />
<br />
The core of the idea is introducing a handful of primitives to Python’s type system:<br />
<ul class="mycode_list"><li>Conditional types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>true_type if bool_type else false_type</code></div></div>).<br />
<br />
</li>
<li>Comprehension types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>*&#91;t for t in Iter&#91;iter_t&#93;&#93;</code></div></div>). Comprehension types can have conditional <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>if</code></div></div> clauses, just like regular comprehensions.<br />
<br />
</li>
<li>Member types (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typing.Members&#91;t&#93;</code></div></div> would return an iterable of the type’s members). <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>member.name</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>member.type</code></div></div> would be properties of the member.<br />
<br />
</li>
</ul>
<br />
The PEP was “inspired by TypeScript, but importantly &#91;the PEP&#93; is not modeled after TypeScript”. Michael noted that Python and JavaScript are “very different languages”, so the system ended up looking “quite a bit different”. The PEP was also designed so that no new keywords would be required to adopt it.<br />
<br />
PEP 827 contains many other proposed features that Michael didn’t have time to cover, including new operators, callable special construction, tuple slicing and length, iterating over unions, getting types of an attribute, inspecting initializers, and ways to handle <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__init_subclass__</code></div></div> decorators. The PEP contains a <a href="https://github.com/msullivan/mypy-typemap/tree/typemap" target="_blank" rel="noopener" class="mycode_url">mypy-based prototype</a> for all the features being proposed.<br />
<br />
How to store type annotations?<br />
<br />
Having introduced the PEP, Michael then returned to his original motivation: discussing how to store type annotations for runtime use. Popular libraries like <a href="https://docs.pydantic.dev/" target="_blank" rel="noopener" class="mycode_url">Pydantic</a> and <a href="https://fastapi.tiangolo.com/" target="_blank" rel="noopener" class="mycode_url">FastAPI</a> use type annotations at runtime to drive their behavior. “This was complicated by our desire to use Python-y syntax”, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>if</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>for</code></div></div>, and dot notation.<br />
In concrete terms, Python will itself <span style="font-style: italic;" class="mycode_i">evaluate</span> the types at runtime. In order to implement everything in PEP 827, there would need to be a way to access the <span style="font-style: italic;" class="mycode_i">unevaluated</span> type even after Python had<br />
executed the conditionals or iterations. As currently drafted, “the PEP is carefully designed to support an evaluator that works by calling the <a href="https://docs.python.org/3/reference/datamodel.html#object.__annotate__" target="_blank" rel="noopener" class="mycode_url">__annotate__()</a> functions”.<br />
<br />
There’s already a module, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib</code></div></div>, which has a “string format” (<a href="https://docs.python.org/3/library/annotationlib.html#annotationlib.Format.STRING" target="_blank" rel="noopener" class="mycode_url">Format.STRING</a>). In theory, if you call <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib.get_annotations(..., format=Format.STRING)</code></div></div>, then you’d get the type annotation back unevaluated. “But this isn’t how this function is implemented today”; instead, the function does “dreadfully clever stuff” using proxy objects that overload every dunder method.<br />
<br />
Imogen Hergeth has <a href="https://peps.python.org/pep-0849/" target="_blank" rel="noopener" class="mycode_url">drafted PEP 849 proposing a new “AST” format</a> that is related to this problem, but Michael thought it would be smaller and more straightforward to make the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> format work with conditional expressions. “There’s a surprisingly large design space here with trade-offs between time, space, and complexity”.<br />
<br />
One of the original ideas considered by the PEP that moved to <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> functions was “can we just store the strings?” The most straightforward option would be for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> to support <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> in addition to <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>VALUE</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>VALUE_WITH_FAKE_GLOBALS</code></div></div>. The <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> function would get a little bigger, but if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div> is passed as the format, it would return the strings “instead of requiring the library to do something complicated to get there”.<br />
<br />
This approach is fast, but uses more memory by representing annotations redundantly. The team considered whether to do the “even more obvious thing” and evaluated storing <span style="font-style: italic;" class="mycode_i">only the strings</span>. But this isn’t enough; type annotations can refer to local variables, so evaluating them requires more context. “This is the whole reason we moved away from <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>from __future__ import annotations</code></div></div> (<a href="https://peps.python.org/pep-0563/" target="_blank" rel="noopener" class="mycode_url">PEP 563</a>), did <a href="https://peps.python.org/pep-0649/" target="_blank" rel="noopener" class="mycode_url">PEP 649</a>, and added complexity to generating <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div> functions”.<br />
<br />
Michael detailed a proposed alternate approach that saves memory at the expense of computation speed: “If we have the string for a type annotation, and we have the environment closure for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div>, then we can <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>eval()</code></div></div> the string in that closure and it will work. What would that look like?<br />
Generate an <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__</code></div></div> function that only implements the format for <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>STRING</code></div></div>, but is set up to only contain the free variables that the annotation used. If the type annotation refers to local<br />
variables, the annotation will still depend on &#91;the variables&#93;, &#91;the type annotation&#93; wouldn’t directly do anything with &#91;the variables&#93;. &#91;The type annotation&#93; would just build the dictionary with the strings.<br />
We’d have a function in <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>annotationlib</code></div></div> that knows<br />
how to pull &#91;the variables&#93; out, combine that with the strings, and evaluate them &#91;both&#93; properly. We could make <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> call that &#91;annotationlib&#93; function when you ask for an evaluated type annotation”.<br />
This approach would use a lot less memory than using strings, but would be much slower because you’d need to use <a href="https://docs.python.org/3/library/functions.html#eval" target="_blank" rel="noopener" class="mycode_url">eval()</a>.<br />
<br />
Discussion<br />
<br />
Stefan Behnel asked whether accepting PEP 827 would make the type system Turing-complete with the proposed conditionals and comprehensions. Michael replied that the Python type system “is already Turing-complete, but only <span style="font-style: italic;" class="mycode_i">accidentally</span> Turing-complete”. Java had run into this issue with generics with subtyping bounds, and “Python does the same Generic stuff as Java”. “There was never an intention for the type system to be Turing-complete”, therefore accepting PEP 827 would only change the type system to be “intentionally Turing-complete”.<br />
<br />
<img src="https://blog.python.org/_astro/lukasz.BGVjyFf-_1NeITT.webp" loading="lazy"  alt="[Image: lukasz.BGVjyFf-_1NeITT.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Łukasz Langa commented on the aesthetics of the proposed syntax, pointing out the example of the comprehensions with “stars”. He cautioned core developers against seeing this syntax and having a knee-jerk negative reaction, such as thinking: “Oh &#91;f-string&#93;, they’re going to make type hints look even worse”. Łukasz was clear that “…these features are for &#91;frameworks&#93; to implement internally &#91;features&#93; that allow type checkers to magically generate the correct types”. “Users are not meant to write types like these or only use them very rarely”.<br />
<br />
Łukasz also commented on the performance of using strings: when he first wrote <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>from __future__ import annotations</code></div></div>, one of the motivations was that strings are “<a href="https://docs.python.org/3/library/sys.html#sys.intern" target="_blank" rel="noopener" class="mycode_url">interned</a>”. Using string interning for types would take “less memory”. The problem was that the alphabet for interning strings doesn’t allow for square brackets (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#91;&#93;</code></div></div>), which are used often in Python type annotations. There was a question whether this could be changed in Python, to which Łukasz replied that “we could, but then we ruin Python for everybody else” because this behavior has been “relied on for over 30 years”. “However…”, Łukasz continued, “what if <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>__annotate__()</code></div></div> interned &#91;strings&#93; all the time?” We expect many type annotations to be the same or similar, like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>None</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>str</code></div></div>, and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>str | None</code></div></div>. Łukasz suggested that this method “wouldn’t cost much memory”, which Michael agreed with.<br />
<br />
David Hewitt shared his experience working with TypeScript, where there are very complicated types. “When you’re a TypeScript user and you’re trying to figure out an API, you start clicking down through the API layers”, and you often hit the issue (“as Łukasz described”, with an accompanying “oh &#91;f-string&#93;”). David was concerned about whether this new syntax would be something that users would encounter frequently.<br />
<br />
Michael confessed that users clicking into “the select method” on an ORM would “see a wild type” and “there’s no getting around that”. “…but hopefully they’ll see the docstring first. If they look at the return type they’ll see something nice”. “I think there are cases where you’re doing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>select(User)</code></div></div> you might be able to populate specific properties”, but this would be “potentially finicky” and dependent on the language server being used.<br />
<br />
<img src="https://blog.python.org/_astro/yury.DW7jflfY_rh2R8.webp" loading="lazy"  alt="[Image: yury.DW7jflfY_rh2R8.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
“There will be moments where users discover that the world is complex”, Yury Selivanov, a co-author of the PEP, said, acknowledging the need for complex type annotations. “Right now the world is not typed”. “The Python type system does not match the expressiveness of the language”. “Certainly some people might be confused”, he added, listing a few ways to mitigate this issue, such as better IDEs, language servers, and documentation.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Free-Threaded Python Post-Era (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113562.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:08 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113562.html</guid>
			<description><![CDATA[Tobias Wrigstad and Fridtjof Stoldt returned to the Python Language Summit, now joined by Donghee Na. Tobias and Fridtjof previously presented “<a href="https://pyfound.blogspot.com/2025/06/python-language-summit-2025-fearless-concurrency.html" target="_blank" rel="noopener" class="mycode_url">Fearless Concurrency</a>” to the Python Language Summit in 2025. This year the topic at hand was the “post-era of free-threading Python”, and what high-level concurrency primitives would be provided by Python.<br />
<br />
<img src="https://blog.python.org/_astro/donghee.BID0cVkn_18ImFg.webp" loading="lazy"  alt="[Image: donghee.BID0cVkn_18ImFg.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Comfortable doesn’t mean “Good”<br />
<br />
Today the interface for accessing free-threading is, unsurprisingly, “threads”. Threads are how people typically first learn about true parallelism from school, textbooks, and other familiar materials. But what if threads as a user interface aren’t very good? Using threads means users need to care about deadlocks and race conditions.<br />
<br />
Python’s free-threading project has made considerable progress since <a href="https://peps.python.org/pep-0779/" target="_blank" rel="noopener" class="mycode_url">PEP 779</a>’s acceptance. But there was one aspect of PEP 779’s acceptance criteria that hadn’t been addressed yet: high-level concurrency primitives. The <a href="https://discuss.python.org/t/pep-779-criteria-for-supported-status-for-free-threaded-python/84319/123" target="_blank" rel="noopener" class="mycode_url">Steering Council’s acceptance</a> stated:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Preparation for high-level concurrency primitives.<br />
<br />
The Python core team should begin considering and proposing higher-level concurrency primitives that users can use safely and effectively, without requiring a deep understanding of the underlying threading mechanism. And the SC wishes that this task should be prioritized once the above tasks are stable. We recommend using the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>concurrent</code></div></div> package in the stdlib for this, where appropriate.</blockquote>
<br />
There is some prior art here; other programming languages provide primitives Python can be inspired by, such as Rust’s ownership and borrowing, Go with channels and goroutines, and Erlang with actors and sending messages.<br />
<br />
Fast, Simple, or Safe: what should Python concurrency be?<br />
<br />
The talk opened by contrasting approaches to implementing concurrency in different programming languages on three separate axes that are “sometimes at odds with each other”: speed, simplicity, and safety.<br />
<br />
C is fast and simple, offering direct access to memory through pointers, which also allows dangerous and unsafe operations; C relies on programmer discipline for program correctness. Erlang has multiple threads, but to communicate, data is copied over to the other “actor”, so it’s safe and simple, but performance suffers. Rust is performant and safe, but it’s not simple: “you’ll find yourself often fighting with the <a href="https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html" target="_blank" rel="noopener" class="mycode_url">borrow checker</a>”.<br />
<br />
<img src="https://blog.python.org/_astro/image.BNb4AgB6_Z2d7gE6.webp" loading="lazy"  alt="[Image: image.BNb4AgB6_Z2d7gE6.webp]" class="mycode_img" /><br />
<br />
“Where would we put Python on this triangle?”<br />
<br />
Python using the <a href="https://docs.python.org/3/glossary.html#term-global-interpreter-lock" target="_blank" rel="noopener" class="mycode_url">Global Interpreter Lock (GIL)</a> (represented as a single lock on the graphic) is a simple model, but it’s not completely safe, as the GIL “only protects the runtime”. <a href="https://docs.python.org/3/library/concurrent.interpreters.html" target="_blank" rel="noopener" class="mycode_url">Subinterpreters</a> (represented as multiple locks on the graphic) as a model are safer due to the isolation, but this model isn’t simple or performant due to data copying. Finally, there is <a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threaded Python</a> (racecar in the graphic), which is very similar to C: simple and performant, but it puts the burden on programmers for program correctness and safety.<br />
<br />
The three argued that for a high-level model “safety would be a priority and then performance”, with “simplicity as third”. “Simplicity is at odds with performance”.<br />
<br />
Behavior-Oriented Concurrency (BOC)<br />
<br />
<img src="https://blog.python.org/_astro/fridtjof.xmOPsQ5q_1mPAmh.webp" loading="lazy"  alt="[Image: fridtjof.xmOPsQ5q_1mPAmh.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Behavior-Oriented Concurrency (BOC) is the model the trio is proposing for a high-level concurrency interface for Python. Programs written with the BOC model are task-based. Tasks are lightweight, can run on any core, and cannot deadlock.<br />
<br />
Each task owns data that is protected by mutexes, but unlike the <a href="https://docs.python.org/3/library/threading.html#lock-objects" target="_blank" rel="noopener" class="mycode_url">threading.Lock</a> objects that we’re used to in Python, these mutexes are aware of the data that they protect. This data awareness means that the mutexes can ensure that the data objects are only accessed by a single task at a time, providing isolation and preventing data races. BOC calls these mutexes “Cowns”, meaning “concurrent owner”.<br />
<br />
BOC allows defining which mutexes a task depends on using the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>@when</code></div></div> decorator. One or more mutexes can be specified in this decorator, and tasks can only access data through mutexes that the task depends on. This mechanism is what allows BOC to create a dependency graph across all tasks and data.<br />
<br />
Providing a scheduler with a program written with the above constraints gets you three important properties: no deadlocks, no data races, and good “locking discipline”. The user “wouldn’t need to decide to spawn a thread or subinterpreter”; this would be handled by the runtime. The scheduler would be able to turn detected deadlocks or data races into exceptions instead, detecting these situations ahead of execution.<br />
<br />
Some examples of programs written using locks and threads were then transformed into programs using the BOC model, such as two bank accounts transferring money between them and printing the results:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]from bocpy import Cown, wait, when

class Account:
    def __init__(self, name: str, balance: float):
        """Initialize an account with a starting balance."""
        self.name = name
        self.balance = balance

    def __repr__(self) -&gt; str:
        """Return a readable representation for debugging."""
        return f"Account(name='{self.name}', balance={self.balance})"

def atomic_transfer(src: Cown&#91;Account&#93;, dst: Cown&#91;Account&#93;, amount: float):
    """Move funds from ``src`` to ``dst`` if both are unfrozen and funded."""
    @when(src, dst)
    def do_transfer(src: Cown&#91;Account&#93;, dst: Cown&#91;Account&#93;, amount=amount):
        src_account = src.value
        dst_account = dst.value
        if src_account.balance &gt; amount:
            src_account.balance -= amount
            dst_account.balance += amount

def check_balance(message: str, account: Cown&#91;Account&#93;):
    """Log the current balance of the provided account."""
    @when(account)
    def do_check(account: Cown&#91;Account&#93;, message=message):
(message, account.value)

alice = Cown(Account("Alice", 100))
bob = Cown(Account("Bob", 0))

check_balance("src (before transfer):", alice)
check_balance("dst (before transfer):", bob)
atomic_transfer(alice, bob, 10)
wait()[/code]</code></div></div><br />
There are <a href="https://github.com/microsoft/bocpy/tree/main/examples" target="_blank" rel="noopener" class="mycode_url">many more examples available on GitHub</a>. This proof of concept, implemented using subinterpreters, is available for anyone to try: <a href="https://microsoft.github.io/bocpy" target="_blank" rel="noopener" class="mycode_url">bocpy</a>, available on the <a href="https://pypi.org/project/bocpy" target="_blank" rel="noopener" class="mycode_url">Python Package Index</a>:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]python -m pip install bocpy[/code]</code></div></div><br />
Checking bocpy against their own criteria of simplicity, safety, and performance: bocpy is simple, as can be seen in the above examples. On the safety front, bocpy today runs in “stable Python”, and for this reason only isolation has been implemented so far. “We don’t yet have ownership, you can’t implement &#91;ownership&#93; as a third-party library”, as this would require changes to the runtime. Performance is “good for programs that aren’t communication dominated” due to “communication being expensive for subinterpreters”.<br />
<br />
The bocpy package provides three features:<br />
<ul class="mycode_list"><li>“<a href="https://microsoft.github.io/bocpy/#cowns" target="_blank" rel="noopener" class="mycode_url">Cowns</a>”, or locks with ownership<br />
<br />
</li>
<li><a href="https://microsoft.github.io/bocpy/#behaviors" target="_blank" rel="noopener" class="mycode_url">Behaviors</a> (the tasks spawned with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>@when</code></div></div> decorators)<br />
<br />
</li>
<li>Scheduler (implemented with subinterpreters, with planned support for free-threading)<br />
<br />
</li>
</ul>
<br />
Looking forward, the three have two other proofs of concept that modify the Python runtime “to allow for safe concurrency and create safe abstractions while keeping performance”. The first implements isolation by organizing the heap into isolated groups of objects, where ownership violations would raise an exception from Cowns. The second is for immutability of Python objects (<a href="https://github.com/python/peps/pull/4468" target="_blank" rel="noopener" class="mycode_url">PEP 795</a>).<br />
<br />
The group made it clear that changes to core Python would be needed to support safe concurrency, asking whether Python would trade “some performance for safety”. What primitives do we want to provide in the standard library; are locks enough? And if we do provide primitives, should they be something like bocpy?<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/thomas.pHYihGdK_2eWefg.webp" loading="lazy"  alt="[Image: thomas.pHYihGdK_2eWefg.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Thomas Wouters recalled that the core team “has experience trying to create universal interfaces for subprocesses, multiprocessing, threading”. In practice, there are always corner cases, and performance is suboptimal because of the constraints of the APIs. Thomas asked “how confident &#91;the three&#93; are that this isn’t the case for bocpy?” The three shared Thomas’s concern. “This is a question we’re working on”, answered Fridtjof. “If you have &#91;the bocpy&#93; ownership model it’s possible to treat subinterpreters and threads similarly, you can have communication, and you can share objects directly with the ownership model”.<br />
<br />
“Notion of tasks and schedulers immediately brings async to my head”, David Hewitt said, wondering “how does async fit into this picture?” He asked the trio whether bocpy “should be built on <a href="https://docs.python.org/3/library/asyncio.html" target="_blank" rel="noopener" class="mycode_url">asyncio</a>” and have “async mutex primitives instead of being &#91;synchronous&#93;”. Tobias confirmed that bocpy “could be” built using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>asyncio</code></div></div>: “it depends on what backend infrastructure” is used and the trade-offs of each backend. “If you want to do some I/O, you tell the I/O library to put something into a cown once data is available and schedule a task to run when the data is available to avoid blocking”.<br />
<br />
Larry Hastings was “happy to see this research going on” and welcomed more from the group, but didn’t see bocpy or any singular solution as “the” method to do concurrency in Python. “&#91;Larry&#93; would like Python to have all the tools that give you and other groups with competing ideas the ability to implement ideas and provide them to users”. Instead, Larry was wary of “anointing a single way”, to avoid locking Python into a particular implementation in case better options are discovered later. Donghee shared that the group wasn’t initially trying to force a single way, only to start the conversation.<br />
<br />
<img src="https://blog.python.org/_astro/tobias.OzZPmRzq_WUjhu.webp" loading="lazy"  alt="[Image: tobias.OzZPmRzq_WUjhu.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Fridtjof brought up Rust as an example of where not providing high-level primitives on top of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>async</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>await</code></div></div> resulted in a “split” in the Rust ecosystem. “Sounds lively”, Larry responded.<br />
<br />
<img src="https://blog.python.org/_astro/david.BP8zASPA_22Lbae.webp" loading="lazy"  alt="[Image: david.BP8zASPA_22Lbae.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
David Hewitt shared that a lot of the Rust community regards the “Rust async situation” as “slightly failed”, as the standard library lacked any standard interface for the runtime. As a result, the entire Rust ecosystem has been “forced” to converge on <a href="https://tokio.rs/" target="_blank" rel="noopener" class="mycode_url">Tokio</a>. David agreed with Thomas that it would be “tough to come up with a good abstraction”, but that this “doesn’t mean we shouldn’t try”.]]></description>
			<content:encoded><![CDATA[Tobias Wrigstad and Fridtjof Stoldt returned to the Python Language Summit, now joined by Donghee Na. Tobias and Fridtjof previously presented “<a href="https://pyfound.blogspot.com/2025/06/python-language-summit-2025-fearless-concurrency.html" target="_blank" rel="noopener" class="mycode_url">Fearless Concurrency</a>” to the Python Language Summit in 2025. This year the topic at hand was the “post-era of free-threading Python”, and what high-level concurrency primitives would be provided by Python.<br />
<br />
<img src="https://blog.python.org/_astro/donghee.BID0cVkn_18ImFg.webp" loading="lazy"  alt="[Image: donghee.BID0cVkn_18ImFg.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Comfortable doesn’t mean “Good”<br />
<br />
Today the interface for accessing free-threading is, unsurprisingly, “threads”. Threads are how people typically first learn about true parallelism from school, textbooks, and other familiar materials. But what if threads as a user interface aren’t very good? Using threads means users need to care about deadlocks and race conditions.<br />
<br />
Python’s free-threading project has made considerable progress since <a href="https://peps.python.org/pep-0779/" target="_blank" rel="noopener" class="mycode_url">PEP 779</a>’s acceptance. But there was one aspect of PEP 779’s acceptance criteria that hadn’t been addressed yet: high-level concurrency primitives. The <a href="https://discuss.python.org/t/pep-779-criteria-for-supported-status-for-free-threaded-python/84319/123" target="_blank" rel="noopener" class="mycode_url">Steering Council’s acceptance</a> stated:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Preparation for high-level concurrency primitives.<br />
<br />
The Python core team should begin considering and proposing higher-level concurrency primitives that users can use safely and effectively, without requiring a deep understanding of the underlying threading mechanism. And the SC wishes that this task should be prioritized once the above tasks are stable. We recommend using the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>concurrent</code></div></div> package in the stdlib for this, where appropriate.</blockquote>
<br />
There is some prior art here; other programming languages provide primitives Python can be inspired by, such as Rust’s ownership and borrowing, Go with channels and goroutines, and Erlang with actors and sending messages.<br />
<br />
Fast, Simple, or Safe: what should Python concurrency be?<br />
<br />
The talk opened by contrasting approaches to implementing concurrency in different programming languages on three separate axes that are “sometimes at odds with each other”: speed, simplicity, and safety.<br />
<br />
C is fast and simple, offering direct access to memory through pointers, which also allows dangerous and unsafe operations; C relies on programmer discipline for program correctness. Erlang has multiple threads, but to communicate, data is copied over to the other “actor”, so it’s safe and simple, but performance suffers. Rust is performant and safe, but it’s not simple: “you’ll find yourself often fighting with the <a href="https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html" target="_blank" rel="noopener" class="mycode_url">borrow checker</a>”.<br />
<br />
<img src="https://blog.python.org/_astro/image.BNb4AgB6_Z2d7gE6.webp" loading="lazy"  alt="[Image: image.BNb4AgB6_Z2d7gE6.webp]" class="mycode_img" /><br />
<br />
“Where would we put Python on this triangle?”<br />
<br />
Python using the <a href="https://docs.python.org/3/glossary.html#term-global-interpreter-lock" target="_blank" rel="noopener" class="mycode_url">Global Interpreter Lock (GIL)</a> (represented as a single lock on the graphic) is a simple model, but it’s not completely safe, as the GIL “only protects the runtime”. <a href="https://docs.python.org/3/library/concurrent.interpreters.html" target="_blank" rel="noopener" class="mycode_url">Subinterpreters</a> (represented as multiple locks on the graphic) as a model are safer due to the isolation, but this model isn’t simple or performant due to data copying. Finally, there is <a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threaded Python</a> (racecar in the graphic), which is very similar to C: simple and performant, but it puts the burden on programmers for program correctness and safety.<br />
<br />
The three argued that for a high-level model “safety would be a priority and then performance”, with “simplicity as third”. “Simplicity is at odds with performance”.<br />
<br />
Behavior-Oriented Concurrency (BOC)<br />
<br />
<img src="https://blog.python.org/_astro/fridtjof.xmOPsQ5q_1mPAmh.webp" loading="lazy"  alt="[Image: fridtjof.xmOPsQ5q_1mPAmh.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Behavior-Oriented Concurrency (BOC) is the model the trio is proposing for a high-level concurrency interface for Python. Programs written with the BOC model are task-based. Tasks are lightweight, can run on any core, and cannot deadlock.<br />
<br />
Each task owns data that is protected by mutexes, but unlike the <a href="https://docs.python.org/3/library/threading.html#lock-objects" target="_blank" rel="noopener" class="mycode_url">threading.Lock</a> objects that we’re used to in Python, these mutexes are aware of the data that they protect. This data awareness means that the mutexes can ensure that the data objects are only accessed by a single task at a time, providing isolation and preventing data races. BOC calls these mutexes “Cowns”, meaning “concurrent owner”.<br />
<br />
BOC allows defining which mutexes a task depends on using the <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>@when</code></div></div> decorator. One or more mutexes can be specified in this decorator, and tasks can only access data through mutexes that the task depends on. This mechanism is what allows BOC to create a dependency graph across all tasks and data.<br />
<br />
Providing a scheduler with a program written with the above constraints gets you three important properties: no deadlocks, no data races, and good “locking discipline”. The user “wouldn’t need to decide to spawn a thread or subinterpreter”; this would be handled by the runtime. The scheduler would be able to turn detected deadlocks or data races into exceptions instead, detecting these situations ahead of execution.<br />
<br />
Some examples of programs written using locks and threads were then transformed into programs using the BOC model, such as two bank accounts transferring money between them and printing the results:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]from bocpy import Cown, wait, when

class Account:
    def __init__(self, name: str, balance: float):
        """Initialize an account with a starting balance."""
        self.name = name
        self.balance = balance

    def __repr__(self) -&gt; str:
        """Return a readable representation for debugging."""
        return f"Account(name='{self.name}', balance={self.balance})"

def atomic_transfer(src: Cown&#91;Account&#93;, dst: Cown&#91;Account&#93;, amount: float):
    """Move funds from ``src`` to ``dst`` if both are unfrozen and funded."""
    @when(src, dst)
    def do_transfer(src: Cown&#91;Account&#93;, dst: Cown&#91;Account&#93;, amount=amount):
        src_account = src.value
        dst_account = dst.value
        if src_account.balance &gt; amount:
            src_account.balance -= amount
            dst_account.balance += amount

def check_balance(message: str, account: Cown&#91;Account&#93;):
    """Log the current balance of the provided account."""
    @when(account)
    def do_check(account: Cown&#91;Account&#93;, message=message):
(message, account.value)

alice = Cown(Account("Alice", 100))
bob = Cown(Account("Bob", 0))

check_balance("src (before transfer):", alice)
check_balance("dst (before transfer):", bob)
atomic_transfer(alice, bob, 10)
wait()[/code]</code></div></div><br />
There are <a href="https://github.com/microsoft/bocpy/tree/main/examples" target="_blank" rel="noopener" class="mycode_url">many more examples available on GitHub</a>. This proof of concept, implemented using subinterpreters, is available for anyone to try: <a href="https://microsoft.github.io/bocpy" target="_blank" rel="noopener" class="mycode_url">bocpy</a>, available on the <a href="https://pypi.org/project/bocpy" target="_blank" rel="noopener" class="mycode_url">Python Package Index</a>:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]python -m pip install bocpy[/code]</code></div></div><br />
Checking bocpy against their own criteria of simplicity, safety, and performance: bocpy is simple, as can be seen in the above examples. On the safety front, bocpy today runs in “stable Python”, and for this reason only isolation has been implemented so far. “We don’t yet have ownership, you can’t implement &#91;ownership&#93; as a third-party library”, as this would require changes to the runtime. Performance is “good for programs that aren’t communication dominated” due to “communication being expensive for subinterpreters”.<br />
<br />
The bocpy package provides three features:<br />
<ul class="mycode_list"><li>“<a href="https://microsoft.github.io/bocpy/#cowns" target="_blank" rel="noopener" class="mycode_url">Cowns</a>”, or locks with ownership<br />
<br />
</li>
<li><a href="https://microsoft.github.io/bocpy/#behaviors" target="_blank" rel="noopener" class="mycode_url">Behaviors</a> (the tasks spawned with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>@when</code></div></div> decorators)<br />
<br />
</li>
<li>Scheduler (implemented with subinterpreters, with planned support for free-threading)<br />
<br />
</li>
</ul>
<br />
Looking forward, the three have two other proofs of concept that modify the Python runtime “to allow for safe concurrency and create safe abstractions while keeping performance”. The first implements isolation by organizing the heap into isolated groups of objects, where ownership violations would raise an exception from Cowns. The second is for immutability of Python objects (<a href="https://github.com/python/peps/pull/4468" target="_blank" rel="noopener" class="mycode_url">PEP 795</a>).<br />
<br />
The group made it clear that changes to core Python would be needed to support safe concurrency, asking whether Python would trade “some performance for safety”. What primitives do we want to provide in the standard library; are locks enough? And if we do provide primitives, should they be something like bocpy?<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/thomas.pHYihGdK_2eWefg.webp" loading="lazy"  alt="[Image: thomas.pHYihGdK_2eWefg.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Thomas Wouters recalled that the core team “has experience trying to create universal interfaces for subprocesses, multiprocessing, threading”. In practice, there are always corner cases, and performance is suboptimal because of the constraints of the APIs. Thomas asked “how confident &#91;the three&#93; are that this isn’t the case for bocpy?” The three shared Thomas’s concern. “This is a question we’re working on”, answered Fridtjof. “If you have &#91;the bocpy&#93; ownership model it’s possible to treat subinterpreters and threads similarly, you can have communication, and you can share objects directly with the ownership model”.<br />
<br />
“Notion of tasks and schedulers immediately brings async to my head”, David Hewitt said, wondering “how does async fit into this picture?” He asked the trio whether bocpy “should be built on <a href="https://docs.python.org/3/library/asyncio.html" target="_blank" rel="noopener" class="mycode_url">asyncio</a>” and have “async mutex primitives instead of being &#91;synchronous&#93;”. Tobias confirmed that bocpy “could be” built using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>asyncio</code></div></div>: “it depends on what backend infrastructure” is used and the trade-offs of each backend. “If you want to do some I/O, you tell the I/O library to put something into a cown once data is available and schedule a task to run when the data is available to avoid blocking”.<br />
<br />
Larry Hastings was “happy to see this research going on” and welcomed more from the group, but didn’t see bocpy or any singular solution as “the” method to do concurrency in Python. “&#91;Larry&#93; would like Python to have all the tools that give you and other groups with competing ideas the ability to implement ideas and provide them to users”. Instead, Larry was wary of “anointing a single way”, to avoid locking Python into a particular implementation in case better options are discovered later. Donghee shared that the group wasn’t initially trying to force a single way, only to start the conversation.<br />
<br />
<img src="https://blog.python.org/_astro/tobias.OzZPmRzq_WUjhu.webp" loading="lazy"  alt="[Image: tobias.OzZPmRzq_WUjhu.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Fridtjof brought up Rust as an example of where not providing high-level primitives on top of <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>async</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>await</code></div></div> resulted in a “split” in the Rust ecosystem. “Sounds lively”, Larry responded.<br />
<br />
<img src="https://blog.python.org/_astro/david.BP8zASPA_22Lbae.webp" loading="lazy"  alt="[Image: david.BP8zASPA_22Lbae.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
David Hewitt shared that a lot of the Rust community regards the “Rust async situation” as “slightly failed”, as the standard library lacked any standard interface for the runtime. As a result, the entire Rust ecosystem has been “forced” to converge on <a href="https://tokio.rs/" target="_blank" rel="noopener" class="mycode_url">Tokio</a>. David agreed with Thomas that it would be “tough to come up with a good abstraction”, but that this “doesn’t mean we shouldn’t try”.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Developer-in-Residence Update & Future (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113554.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:07 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113554.html</guid>
			<description><![CDATA[The first three <a href="https://www.python.org/psf/developersinresidence/" target="_blank" rel="noopener" class="mycode_url">Python Developers-in-Residence</a> are Łukasz Langa, Petr Viktorin, and Serhiy Storchaka. Now that Developer-in-Residence Łukasz is <a href="https://pyfound.blogspot.com/2026/04/reflecting-on-five-years-as-psfs-first.html" target="_blank" rel="noopener" class="mycode_url">moving on from the role after five years</a>, the now-“ironically named” <span style="font-style: italic;" class="mycode_i">Deputy</span> Developer-in-Residence Petr came to the Language Summit to give an update on the role and ask core developers what’s next.<br />
<br />
<img src="https://blog.python.org/_astro/image.BizptPIq_Z1133bU.webp" loading="lazy"  alt="[Image: image.BizptPIq_Z1133bU.webp]" class="mycode_img" /><br />
<br />
Petr started the discussion by listing the responsibilities in his contract:<br />
<ul class="mycode_list"><li>Keeping the core development workflow operational to ensure core developers and collaborators are not blocked from contribution.<br />
<br />
</li>
<li>Improving tools and workflows, which are part of the core development experience, to enable a smoother contribution process.<br />
<br />
</li>
<li>Code review of a subset of incoming changes to CPython to help collaborators receive timely communications on their changes.<br />
<br />
</li>
<li>Authoring own changes to CPython to help clean the issue and PR backlog.<br />
<br />
</li>
<li>Responding to requests for assistance from core developers in a timely manner.<br />
<br />
</li>
<li>Regularly reporting on this work to the Steering Council and the wider community.<br />
<br />
</li>
<li>Additional responsibilities as directed.<br />
<br />
</li>
</ul>
<br />
<img src="https://blog.python.org/_astro/petr.B8DFRyQD_Z11P3Rl.webp" loading="lazy"  alt="[Image: petr.B8DFRyQD_Z11P3Rl.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Referencing the explicit “Responding to requests for assistance from core developers”, Petr noted that there “haven’t been that many requests for assistance” recently, so he wanted to ask core developers to communicate what they might want done, either at the Language Summit or later.<br />
<br />
Petr continued with an update on what he’d accomplished from 2024 to 2026, including maintaining <a href="https://devguide.python.org/testing/buildbots/" target="_blank" rel="noopener" class="mycode_url">buildbots</a>, mentoring multiple people into becoming triagers or core developers, working on the <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a> for <a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threaded Python</a>, working on security vulnerability fixes, and managing CPython sprints at conferences. He compared this work to what Łukasz had accomplished in his five years of tenure, which included more “large-scale project management”, organizing events like the Language Summit, talking to sponsors, and overseeing the other Python Developers-in-Residence.<br />
<br />
Petr summarized his approach to the role as focusing on “important tasks, but leaving fun and glamorous ones to volunteers”. He also noted collaborating with people in other “Developer-in-Residence”-like roles, such as Hugo van Kemenade and Stan Ulbrych, who are <a href="https://www.sovereign.tech/news/meet-the-2026-sovereign-tech-fellows" target="_blank" rel="noopener" class="mycode_url">Sovereign Tech Agency fellows</a> focusing on CPython. Petr opened the floor for discussion by asking what challenges core developers would like the Developers-in-Residence to focus on.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/attendees.Ba9PXSZB_Z1ah3oM.webp" loading="lazy"  alt="[Image: attendees.Ba9PXSZB_Z1ah3oM.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514508361/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
“Thank you for doing all the boring stuff”, Ken Jin opened, appreciating Petr taking on grunt work that enables other core developers, and sharing that if he had to do this work as a volunteer he “would have quit a long time ago”.<br />
<br />
“You don’t have to do everything Łukasz did”, Thomas Wouters assured Petr, “we’re hiring a replacement for Łukasz and will sort out what that means for the team”, reminding everyone that the Steering Council members are all volunteers themselves, that managing multiple full-time employees is difficult, and that hiring takes time.<br />
<br />
Former Developer-in-Residence Łukasz Langa chimed in with a problem he and other core developers had noticed: the large volume of (likely) LLM-generated pull requests being submitted to CPython. One of Łukasz’s early goals for CPython <a href="https://lukasz.langa.pl/a072a74b-19d7-41ff-a294-e6b1319fdb6e/" target="_blank" rel="noopener" class="mycode_url">when he joined as Developer-in-Residence</a> was “addressing the PR backlog”, which was successful for some time, but that progress has now completely reversed with LLMs. Łukasz suggested either triaging these PRs somehow, noting he wasn’t sure “how many full-time jobs that task is”, or coming up with “some systematic solution”.<br />
Petr confirmed triaging every LLM pull request wasn’t something he wanted to do, but he was “hired to also do tasks he didn’t want to do”.<br />
<br />
There was some discussion between Stefan Behnel and Mark Shannon about ensuring some amount of review “before a human looks at a pull request”, such as having an LLM provide a first pass on a pull request.<br />
<br />
<img src="https://blog.python.org/_astro/savannah.Cx7crnGX_Z1ee5FG.webp" loading="lazy"  alt="[Image: savannah.Cx7crnGX_Z1ee5FG.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Savannah Ostrowski was hesitant to engage with drive-by LLM contributions: “I’m not willing to give away my time because it won’t change their behavior”. She suggested that other core developers “nope out” if they didn’t want to engage.<br />
<br />
Mark Shannon recommended everyone <iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/e8uozuvRf7g" frameborder="0" allowfullscreen="true"></iframe>.<br />
There is also a Language Summit Lightning Talk by Gregory P. Smith and Łukasz Langa about attempting to<br />
steer or improve these contributions <a href="https://blog.python.org/2026/09/language-summit-2026-lightning-talks#agentsmd-for-cpython" target="_blank" rel="noopener" class="mycode_url">using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div></a>.]]></description>
			<content:encoded><![CDATA[The first three <a href="https://www.python.org/psf/developersinresidence/" target="_blank" rel="noopener" class="mycode_url">Python Developers-in-Residence</a> are Łukasz Langa, Petr Viktorin, and Serhiy Storchaka. Now that Developer-in-Residence Łukasz is <a href="https://pyfound.blogspot.com/2026/04/reflecting-on-five-years-as-psfs-first.html" target="_blank" rel="noopener" class="mycode_url">moving on from the role after five years</a>, the now-“ironically named” <span style="font-style: italic;" class="mycode_i">Deputy</span> Developer-in-Residence Petr came to the Language Summit to give an update on the role and ask core developers what’s next.<br />
<br />
<img src="https://blog.python.org/_astro/image.BizptPIq_Z1133bU.webp" loading="lazy"  alt="[Image: image.BizptPIq_Z1133bU.webp]" class="mycode_img" /><br />
<br />
Petr started the discussion by listing the responsibilities in his contract:<br />
<ul class="mycode_list"><li>Keeping the core development workflow operational to ensure core developers and collaborators are not blocked from contribution.<br />
<br />
</li>
<li>Improving tools and workflows, which are part of the core development experience, to enable a smoother contribution process.<br />
<br />
</li>
<li>Code review of a subset of incoming changes to CPython to help collaborators receive timely communications on their changes.<br />
<br />
</li>
<li>Authoring own changes to CPython to help clean the issue and PR backlog.<br />
<br />
</li>
<li>Responding to requests for assistance from core developers in a timely manner.<br />
<br />
</li>
<li>Regularly reporting on this work to the Steering Council and the wider community.<br />
<br />
</li>
<li>Additional responsibilities as directed.<br />
<br />
</li>
</ul>
<br />
<img src="https://blog.python.org/_astro/petr.B8DFRyQD_Z11P3Rl.webp" loading="lazy"  alt="[Image: petr.B8DFRyQD_Z11P3Rl.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Referencing the explicit “Responding to requests for assistance from core developers”, Petr noted that there “haven’t been that many requests for assistance” recently, so he wanted to ask core developers to communicate what they might want done, either at the Language Summit or later.<br />
<br />
Petr continued with an update on what he’d accomplished from 2024 to 2026, including maintaining <a href="https://devguide.python.org/testing/buildbots/" target="_blank" rel="noopener" class="mycode_url">buildbots</a>, mentoring multiple people into becoming triagers or core developers, working on the <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a> for <a href="https://docs.python.org/3/howto/free-threading-python.html" target="_blank" rel="noopener" class="mycode_url">free-threaded Python</a>, working on security vulnerability fixes, and managing CPython sprints at conferences. He compared this work to what Łukasz had accomplished in his five years of tenure, which included more “large-scale project management”, organizing events like the Language Summit, talking to sponsors, and overseeing the other Python Developers-in-Residence.<br />
<br />
Petr summarized his approach to the role as focusing on “important tasks, but leaving fun and glamorous ones to volunteers”. He also noted collaborating with people in other “Developer-in-Residence”-like roles, such as Hugo van Kemenade and Stan Ulbrych, who are <a href="https://www.sovereign.tech/news/meet-the-2026-sovereign-tech-fellows" target="_blank" rel="noopener" class="mycode_url">Sovereign Tech Agency fellows</a> focusing on CPython. Petr opened the floor for discussion by asking what challenges core developers would like the Developers-in-Residence to focus on.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/attendees.Ba9PXSZB_Z1ah3oM.webp" loading="lazy"  alt="[Image: attendees.Ba9PXSZB_Z1ah3oM.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514508361/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
“Thank you for doing all the boring stuff”, Ken Jin opened, appreciating Petr taking on grunt work that enables other core developers, and sharing that if he had to do this work as a volunteer he “would have quit a long time ago”.<br />
<br />
“You don’t have to do everything Łukasz did”, Thomas Wouters assured Petr, “we’re hiring a replacement for Łukasz and will sort out what that means for the team”, reminding everyone that the Steering Council members are all volunteers themselves, that managing multiple full-time employees is difficult, and that hiring takes time.<br />
<br />
Former Developer-in-Residence Łukasz Langa chimed in with a problem he and other core developers had noticed: the large volume of (likely) LLM-generated pull requests being submitted to CPython. One of Łukasz’s early goals for CPython <a href="https://lukasz.langa.pl/a072a74b-19d7-41ff-a294-e6b1319fdb6e/" target="_blank" rel="noopener" class="mycode_url">when he joined as Developer-in-Residence</a> was “addressing the PR backlog”, which was successful for some time, but that progress has now completely reversed with LLMs. Łukasz suggested either triaging these PRs somehow, noting he wasn’t sure “how many full-time jobs that task is”, or coming up with “some systematic solution”.<br />
Petr confirmed triaging every LLM pull request wasn’t something he wanted to do, but he was “hired to also do tasks he didn’t want to do”.<br />
<br />
There was some discussion between Stefan Behnel and Mark Shannon about ensuring some amount of review “before a human looks at a pull request”, such as having an LLM provide a first pass on a pull request.<br />
<br />
<img src="https://blog.python.org/_astro/savannah.Cx7crnGX_Z1ee5FG.webp" loading="lazy"  alt="[Image: savannah.Cx7crnGX_Z1ee5FG.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Savannah Ostrowski was hesitant to engage with drive-by LLM contributions: “I’m not willing to give away my time because it won’t change their behavior”. She suggested that other core developers “nope out” if they didn’t want to engage.<br />
<br />
Mark Shannon recommended everyone <iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/e8uozuvRf7g" frameborder="0" allowfullscreen="true"></iframe>.<br />
There is also a Language Summit Lightning Talk by Gregory P. Smith and Łukasz Langa about attempting to<br />
steer or improve these contributions <a href="https://blog.python.org/2026/09/language-summit-2026-lightning-talks#agentsmd-for-cpython" target="_blank" rel="noopener" class="mycode_url">using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>AGENTS.md</code></div></div></a>.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Spicycrab (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113505.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:06 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113505.html</guid>
			<description><![CDATA[Kushal Das brought a project that fills a niche for Python users who hit a performance wall that can’t be solved by scaling horizontally, but who also don’t want to learn a new programming language. <a href="https://github.com/kushaldas/spicycrab/" target="_blank" rel="noopener" class="mycode_url">Spicycrab</a> is a Python-to-Rust transpiler named for Kushal’s love of spicy food. The demonstration showed compiling a simple Python script to Rust source code and then into an executable binary.<br />
<br />
<img src="https://blog.python.org/_astro/kushal.DuG-fxFN_Zhn59g.webp" loading="lazy"  alt="[Image: kushal.DuG-fxFN_Zhn59g.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]crabpy transpile greet.py -o greet[/code]</code></div></div><br />
This simple demo produces Rust source code at <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>greet/src/main.rs</code></div></div>, which can be run with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>cargo run</code></div></div>.<br />
<br />
Who is this for?<br />
<br />
After introducing the tool, Kushal shared more about who could benefit from a tool like Spicycrab.<br />
<br />
Back when Kushal was working with Django, there would often be a moment where the web service could no longer scale on the single virtual machine that was allocated to the team. At that time in 2008, the only option was to learn to write <a href="https://docs.python.org/3/extending/index.html" target="_blank" rel="noopener" class="mycode_url">C extensions</a> for the “hot paths”, but this approach meant you weren’t writing Python and you had to contend with crashes and security issues from writing C.<br />
<br />
Now that Rust is here, some of the challenges like security and crashing are addressed, but Rust’s “syntax breaks &#91;his&#93; brain” (although <a href="https://pyo3.rs/" target="_blank" rel="noopener" class="mycode_url">PyO3</a> helps). Kushal wanted to get more people taking advantage of Rust’s performance without needing to learn Rust.<br />
<br />
Kushal shared that many smaller organizations he knows in this exact resource-constrained situation would move away from a programming language like Python towards a language like Go for web backends. Kushal wanted to provide a tool that offers easy performance without needing to leave Python behind. “I hope that Python can become that fast one day, but what can we do until then?”<br />
<br />
Next, Kushal demonstrated <a href="https://spicycrab.readthedocs.io/en/latest/actix_web.html" target="_blank" rel="noopener" class="mycode_url">an async web service using actix-web</a>, which includes <a href="https://docs.python.org/3/library/typing.html" target="_blank" rel="noopener" class="mycode_url">type annotations</a>. This mechanism works by transpiling Python code written using <a href="https://actix.rs/" target="_blank" rel="noopener" class="mycode_url">actix-web</a> patterns into idiomatic Rust, with the actix-web API made available to Python beforehand as a package of generated stubs.<br />
<br />
Kushal installed actix-web using <a href="https://doc.rust-lang.org/cargo/" target="_blank" rel="noopener" class="mycode_url">Cargo</a>, with a few chuckles as 180 dependencies were downloaded and compiled, a <a href="https://blog.python.org/2026/09/language-summit-2026-rust-for-cpython" target="_blank" rel="noopener" class="mycode_url">callback to some concerns from the “Rust for CPython” project</a> regarding third-party dependencies. After installation and transpiling completed, the following web server was built using Spicycrab:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]from spicycrab_actix_web import App, HttpServer, HttpResponse, get

async def hello() -&gt; HttpResponse:
    return HttpResponse.Ok().body("Hello World!")

async def main() -&gt; None:
    HttpServer.new(App.new().route("/", get().to(hello))).bind("127.0.0.1:8080").run()[/code]</code></div></div><br />
After running the transpiler and compiling again, the resulting binary served the “Hello World!” response over HTTP.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/ken.COD47Lko_1KtLwt.webp" loading="lazy"  alt="[Image: ken.COD47Lko_1KtLwt.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Ken Jin asked why this approach would be chosen over <a href="https://mypyc.readthedocs.io/" target="_blank" rel="noopener" class="mycode_url">mypyc</a>, <a href="https://cython.org/" target="_blank" rel="noopener" class="mycode_url">Cython</a>, or <a href="https://github.com/spylang/spy" target="_blank" rel="noopener" class="mycode_url">SPy</a>. Kushal answered that<br />
“SPy only supports a subset of Python” but admitted that “mypyc is good and in many cases that &#91;mypyc&#93; could be used directly”. Kushal’s primary<br />
motivation for going this route was to solve multiple problems at once, and one of the problems was getting<br />
Python users to use Rust “without being scared of the syntax”.<br />
<br />
<img src="https://blog.python.org/_astro/greg.Z-0E3vTr_25yqou.webp" loading="lazy"  alt="[Image: greg.Z-0E3vTr_25yqou.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Gregory P. Smith provided a “spicier” thought that was “existential for Python”. Greg imagined it becoming more commonplace for state-of-the-art large language models to rewrite code from one programming language to another, such as from Python to Rust for performance. Kushal noted that this solves the issue “one time”, but doesn’t answer how the code is maintained long-term, and that the cost of doing so would be prohibitive for many. As an example, the <a href="https://bun.com/blog/bun-in-rust" target="_blank" rel="noopener" class="mycode_url">rewrite of Bun from Zig to Rust cost &#36;165,000 USD</a>.]]></description>
			<content:encoded><![CDATA[Kushal Das brought a project that fills a niche for Python users who hit a performance wall that can’t be solved by scaling horizontally, but who also don’t want to learn a new programming language. <a href="https://github.com/kushaldas/spicycrab/" target="_blank" rel="noopener" class="mycode_url">Spicycrab</a> is a Python-to-Rust transpiler named for Kushal’s love of spicy food. The demonstration showed compiling a simple Python script to Rust source code and then into an executable binary.<br />
<br />
<img src="https://blog.python.org/_astro/kushal.DuG-fxFN_Zhn59g.webp" loading="lazy"  alt="[Image: kushal.DuG-fxFN_Zhn59g.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]crabpy transpile greet.py -o greet[/code]</code></div></div><br />
This simple demo produces Rust source code at <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>greet/src/main.rs</code></div></div>, which can be run with <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>cargo run</code></div></div>.<br />
<br />
Who is this for?<br />
<br />
After introducing the tool, Kushal shared more about who could benefit from a tool like Spicycrab.<br />
<br />
Back when Kushal was working with Django, there would often be a moment where the web service could no longer scale on the single virtual machine that was allocated to the team. At that time in 2008, the only option was to learn to write <a href="https://docs.python.org/3/extending/index.html" target="_blank" rel="noopener" class="mycode_url">C extensions</a> for the “hot paths”, but this approach meant you weren’t writing Python and you had to contend with crashes and security issues from writing C.<br />
<br />
Now that Rust is here, some of the challenges like security and crashing are addressed, but Rust’s “syntax breaks &#91;his&#93; brain” (although <a href="https://pyo3.rs/" target="_blank" rel="noopener" class="mycode_url">PyO3</a> helps). Kushal wanted to get more people taking advantage of Rust’s performance without needing to learn Rust.<br />
<br />
Kushal shared that many smaller organizations he knows in this exact resource-constrained situation would move away from a programming language like Python towards a language like Go for web backends. Kushal wanted to provide a tool that offers easy performance without needing to leave Python behind. “I hope that Python can become that fast one day, but what can we do until then?”<br />
<br />
Next, Kushal demonstrated <a href="https://spicycrab.readthedocs.io/en/latest/actix_web.html" target="_blank" rel="noopener" class="mycode_url">an async web service using actix-web</a>, which includes <a href="https://docs.python.org/3/library/typing.html" target="_blank" rel="noopener" class="mycode_url">type annotations</a>. This mechanism works by transpiling Python code written using <a href="https://actix.rs/" target="_blank" rel="noopener" class="mycode_url">actix-web</a> patterns into idiomatic Rust, with the actix-web API made available to Python beforehand as a package of generated stubs.<br />
<br />
Kushal installed actix-web using <a href="https://doc.rust-lang.org/cargo/" target="_blank" rel="noopener" class="mycode_url">Cargo</a>, with a few chuckles as 180 dependencies were downloaded and compiled, a <a href="https://blog.python.org/2026/09/language-summit-2026-rust-for-cpython" target="_blank" rel="noopener" class="mycode_url">callback to some concerns from the “Rust for CPython” project</a> regarding third-party dependencies. After installation and transpiling completed, the following web server was built using Spicycrab:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]from spicycrab_actix_web import App, HttpServer, HttpResponse, get

async def hello() -&gt; HttpResponse:
    return HttpResponse.Ok().body("Hello World!")

async def main() -&gt; None:
    HttpServer.new(App.new().route("/", get().to(hello))).bind("127.0.0.1:8080").run()[/code]</code></div></div><br />
After running the transpiler and compiling again, the resulting binary served the “Hello World!” response over HTTP.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/ken.COD47Lko_1KtLwt.webp" loading="lazy"  alt="[Image: ken.COD47Lko_1KtLwt.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Ken Jin asked why this approach would be chosen over <a href="https://mypyc.readthedocs.io/" target="_blank" rel="noopener" class="mycode_url">mypyc</a>, <a href="https://cython.org/" target="_blank" rel="noopener" class="mycode_url">Cython</a>, or <a href="https://github.com/spylang/spy" target="_blank" rel="noopener" class="mycode_url">SPy</a>. Kushal answered that<br />
“SPy only supports a subset of Python” but admitted that “mypyc is good and in many cases that &#91;mypyc&#93; could be used directly”. Kushal’s primary<br />
motivation for going this route was to solve multiple problems at once, and one of the problems was getting<br />
Python users to use Rust “without being scared of the syntax”.<br />
<br />
<img src="https://blog.python.org/_astro/greg.Z-0E3vTr_25yqou.webp" loading="lazy"  alt="[Image: greg.Z-0E3vTr_25yqou.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Gregory P. Smith provided a “spicier” thought that was “existential for Python”. Greg imagined it becoming more commonplace for state-of-the-art large language models to rewrite code from one programming language to another, such as from Python to Rust for performance. Kushal noted that this solves the issue “one time”, but doesn’t answer how the code is maintained long-term, and that the cost of doing so would be prohibitive for many. As an example, the <a href="https://bun.com/blog/bun-in-rust" target="_blank" rel="noopener" class="mycode_url">rewrite of Bun from Zig to Rust cost &#36;165,000 USD</a>.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Rust for CPython (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113547.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:05 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113547.html</guid>
			<description><![CDATA[“No one said ‘don’t do this’ last year”. After <a href="https://pyfound.blogspot.com/2025/06/python-language-summit-2025-what-do-core-developers-want-from-rust.html" target="_blank" rel="noopener" class="mycode_url">testing the waters at PyCon US 2025</a>, David Hewitt returned to the Python Language Summit asking what Python core developers want from Rust, along with proposed timelines, phases, and success criteria for how the Rust for CPython project might proceed and become a permanent fixture within the CPython project.<br />
<br />
<img src="https://blog.python.org/_astro/david.C2A7MwHE_ZzK8Eu.webp" loading="lazy"  alt="[Image: david.C2A7MwHE_ZzK8Eu.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
David is acting as an “ambassador” for the Rust for CPython project team, which is currently led by core developers Kirill Podoprigora and Emma Smith as <a href="https://discuss.python.org/t/pre-pep-rust-for-cpython/104906" target="_blank" rel="noopener" class="mycode_url">authors of the Rust for CPython PEP draft</a>. Emma also <iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/42kibVnUHYE" frameborder="0" allowfullscreen="true"></iframe> about the Rust for CPython project. The team itself is around 60 developers in a Discord channel, among them a “few &#91;Python&#93; core developers” and a “delegation from the Rust project”. The team has experience with previous projects integrating Rust into existing codebases, such as Android and the Linux kernel, and is “excited by the work and keen to support &#91;the project&#93; if we proceed”.<br />
<br />
Why Rust?<br />
<br />
<img src="https://blog.python.org/_astro/type-crash.Dt_NIr5c_Z68UBs.webp" loading="lazy"  alt="[Image: type-crash.Dt_NIr5c_Z68UBs.webp]" class="mycode_img" /><br />
<br />
Showing how adopting Rust may specifically help CPython, David noted how the number of issues labeled with “<a href="https://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aopen%20label%3Atype-crash" target="_blank" rel="noopener" class="mycode_url"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>type-crash</code></div></div></a>” has been steadily rising over time. “We’ve been making some big technical bets”, he said, referencing the <a href="https://peps.python.org/pep-0617/" target="_blank" rel="noopener" class="mycode_url">new parser</a>, the <a href="https://peps.python.org/pep-0744/" target="_blank" rel="noopener" class="mycode_url">JIT</a>, and <a href="https://peps.python.org/pep-0703/" target="_blank" rel="noopener" class="mycode_url">free-threading</a>. These large, complex features may be one of the reasons more crash reports are being opened on GitHub, and Rust could be a potential solution here. David explained that Jeff Vander Stoep described Rust in Android as “move fast and fix things”, and that “fewer revisions for patches of the same size” was the experience Android has had since adopting Rust.<br />
<br />
Rust and Python are already working together in Python’s ecosystem of packages thanks to <a href="https://pyo3.rs" target="_blank" rel="noopener" class="mycode_url">PyO3</a> and <a href="https://pypi.org/project/maturin" target="_blank" rel="noopener" class="mycode_url">Maturin</a>. David also emphasized that many technology companies were “choosing Rust as a bet” instead of only as the new shiny tool.<br />
<br />
But adopting Rust into CPython would not all be smooth sailing; there were still concerns that David and the team are aware of.<br />
<br />
One of the biggest concerns from a year ago was Rust’s lack of platform support compared to CPython, which at the time of writing <a href="https://peps.python.org/pep-0011" target="_blank" rel="noopener" class="mycode_url">officially supports 20 different architectures and platforms</a> at either Tier 1, 2, or 3. David shared that Rust’s support of different platforms has “widened since last year” and was becoming “less and less of a concern”. The proposal would be to ask Python distributors to attempt using the optional Rust support in Python 3.16 (October 2027) and report platform-specific issues upstream in time to be resolved around the Python 3.17 timeline (October 2028).<br />
<br />
David acknowledged that adopting Rust into a project is a social challenge as much as a technical challenge. Rust knowledge is “not universal amongst core developers”, which would be partially mitigated by “targeting small portions” of CPython and an incremental approach, as “1 million lines of C code can’t be ported all at once”.<br />
<br />
David was clear that using Rust in itself does not necessarily mean that ported code would be free of bugs or security issues. Although Rust does mitigate classes of issues that commonly create bugs, the code can still have correctness issues. The team proposes mitigating this by adopting property-based testing, fuzzing, and using “prudent engineering practices” during the porting process.<br />
<br />
The proposed first Rust module: zlib<br />
<br />
Below are the proposed timelines for the Rust for CPython project making a “significant improvement” to CPython, with a PEP defining the success criteria for Rust expected in late 2026. Under this timeline, the first Rust code to ship in Python would be in Python 3.16, where it would be completely optional, with the existing C code kept as a fallback. The earliest that Rust would become required to build CPython is Python 3.18 in 2029, at least three years away.<br />
<br />
<img src="https://blog.python.org/_astro/timeline.SOw1vHVq_1rjKDh.webp" loading="lazy"  alt="[Image: timeline.SOw1vHVq_1rjKDh.webp]" class="mycode_img" /><br />
<br />
The timeline includes a build system and CI, Rust API proof-of-concept happening<br />
in the Summer 2026, a PEP defining success criteria in late 2026,<br />
an optional Rust backend for the zlib module and private Rust API in Python 3.16 (October 2027),<br />
resolving platform issues and Rust in more places (io, json, xml, memoryview, parser)<br />
for Python 3.17 (October 2028). Finally, in some distant Python version (October 2029+)<br />
the Rust build would be made required and a public Rust API would be published.<br />
<br />
The Rust for CPython team has selected the <a href="https://docs.python.org/3/library/zlib.html" target="_blank" rel="noopener" class="mycode_url">zlib module</a> as the first module to be given an optional Rust implementation because they “wanted to achieve a significant improvement” with a “small scope”. The proposed Rust implementation will use <a href="https://crates.io/crates/zlib-rs" target="_blank" rel="noopener" class="mycode_url">zlib-rs</a>, which is “heavily tested and used by the Firefox, uv, and <a href="https://doc.rust-lang.org/cargo/" target="_blank" rel="noopener" class="mycode_url">Cargo</a>” projects and “faster than zlib and zlib-ng on many platforms”. The module was also selected because it’d require using an external Cargo package, meaning this aspect of the build process would need to be designed and exercised.<br />
<br />
This small change would have an impact: the zlib compression algorithm is “widely used by Python packaging”, meaning that (almost) “every <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip install</code></div></div> in Python 3.16 will be sped up” if the proposal is accepted.<br />
<br />
Rust API Sketch<br />
<br />
David provided an example of some Rust code calling a hypothetical Rust API for Python. The API would use a Rust attribute (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#&#91;pyfunction&#93;</code></div></div>) and be similar to <a href="https://devguide.python.org/development-tools/clinic/" target="_blank" rel="noopener" class="mycode_url">Argument Clinic</a>, a development tool for automatically generating blocks of code for handling C function arguments from Pythonic function syntax. Rust functions would always be passed the thread and interpreter state (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Python&lt;'_&gt;</code></div></div>), use smart pointers around objects (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Py&lt;...&gt;</code></div></div>), and lean into Rust error handling with the <a href="https://doc.rust-lang.org/std/result/" target="_blank" rel="noopener" class="mycode_url"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Result</code></div></div></a> enum, returning either a result or an error that was raised.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]#&#91;pyfunction(signature = (
    data,
    /,
    wbits=MAX_WBITS,
    bufsize=DEF_BUF_SIZE,
))&#93;
fn decompress(
    py: Python&lt;'_&gt;,
    data: Py&lt;PyObject&gt;,
    wbits: c_int,
    bufsize: isize
) -&gt; PyResult&lt;Py&lt;PyBytes&gt;, PyErrRaised&gt; {

    // buf will be cleaned on scope exit
    let buf = PyObject::get_buffer(py, &amp;data)?;
    let decoded = /* ... */;

    Ok(PyBytes::new(py, &amp;decoded))
}[/code]</code></div></div><br />
The example above shows a buffer being allocated and automatically cleaned up on scope exit, rather than being cleaned up manually as would be required when writing the same function in C.<br />
<br />
Proposed success criteria<br />
<br />
David moved on to success criteria: what would the Rust for CPython project need to show to move into new phases of the roadmap and eventually become a required part of building CPython? “For previous big changes like the JIT and free-threading, we’ve explicitly defined success criteria that would need to be met in order for the added complexity to be accepted”, David explained, “we expect we’d need to do the same here. What should those criteria be?”<br />
<br />
David had these suggestions for core developers:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Critical:</span> A majority of active core developers are <span style="font-style: italic;" class="mycode_i">open</span> to using the Rust API to implement functionality.<br />
<br />
</li>
<li>No meaningful slowdown to CPython performance benchmarks.<br />
<br />
</li>
<li>All tiered platforms must be supported by Rust. The experience of distributors building CPython should generally indicate that adding Rust support is manageable.<br />
<br />
</li>
</ul>
<br />
David noted that the first point reads “open”, not “familiar”, and shared a plan to survey Python core developers about how they’ve used Rust while contributing to CPython when deciding whether to move Rust out of experimental stages.<br />
<br />
Discussion<br />
<br />
On the topic of designing the new Rust API so that it’s “familiar” to users of the C API, Thomas Wouters advised against “making compromises for the dinosaurs”, including himself in the subset, instead asking whether the Rust API should be designed from first principles. David responded that there are “places to lean into Rust”, such as dropping resources on scope exit, but there are also idiomatic Rust designs which “won’t be the best fit”. David noted that it would be reasonable for core developers to be looking at both the C and Rust API at the same time while working. “We should be mindful of our audience, which is also ourselves”.<br />
<br />
Larry Hastings asked why the Rust for CPython project wasn’t a “rewrite”, suggesting the team “display your success as a fork”. David acknowledged that “<a href="https://github.com/RustPython/RustPython" target="_blank" rel="noopener" class="mycode_url">RustPython</a> already exists” and that the Rust for CPython team had already spoken with the contributors of the project. “RustPython isn’t as performant as CPython, but could be used to inform what APIs we design”.<br />
<br />
Larry also shared that he “wasn’t super excited to learn Rust to work on CPython”. David assured him that there are many areas of CPython that would not be considered for writing in Rust: “CPython should not be written in Rust for the sake of Rust”. “CPython will be a dual-language project for a meaningful amount of time”. However, David cautioned that “it would be disingenuous to say that Rust would be optional forever”, as one of the aforementioned roadmap items for the Rust for CPython project is to become a required part of the build process and provide a public Rust API.<br />
<br />
<img src="https://blog.python.org/_astro/pablo.DKWOlIWN_Z1KSOmd.webp" loading="lazy"  alt="[Image: pablo.DKWOlIWN_Z1KSOmd.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Pablo Galindo Salgado was more concerned about the future, which was “reaching for our dependencies from Cargo”, noting that this would be a “huge problem” and a potential “showstopper” for the project. “We vendor our dependencies, and we have a very selective set”, he said, noting that each time a vulnerability is published for one of those projects, the release managers need to make new releases, which can be “tiresome”. “Right now we’re only focusing on the APIs and the basics”, he added, highlighting that the challenge of taking on many Rust dependencies hasn’t been addressed yet.<br />
<br />
David answered that the team should “select as few external dependencies as possible”; “zlib-rs is only one dependency”, and the Rust sources would be vendored so that “building CPython would not require Cargo”. David added that “Cargo has a relatively clean system for vendoring dependencies” and that the “Rust for CPython proof-of-concept uses this system”. The vendored sources “wouldn’t live in the CPython tree”. Łukasz Langa agreed that “it’s better for dependencies to live separately”, referencing the <a href="https://github.com/python/cpython-source-deps" target="_blank" rel="noopener" class="mycode_url">cpython-source-deps repository</a>, with Thomas reminding everyone that this would be a new usage of that repository; today it is only used for binary installers of CPython.]]></description>
			<content:encoded><![CDATA[“No one said ‘don’t do this’ last year”. After <a href="https://pyfound.blogspot.com/2025/06/python-language-summit-2025-what-do-core-developers-want-from-rust.html" target="_blank" rel="noopener" class="mycode_url">testing the waters at PyCon US 2025</a>, David Hewitt returned to the Python Language Summit asking what Python core developers want from Rust, along with proposed timelines, phases, and success criteria for how the Rust for CPython project might proceed and become a permanent fixture within the CPython project.<br />
<br />
<img src="https://blog.python.org/_astro/david.C2A7MwHE_ZzK8Eu.webp" loading="lazy"  alt="[Image: david.C2A7MwHE_ZzK8Eu.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
David is acting as an “ambassador” for the Rust for CPython project team, which is currently led by core developers Kirill Podoprigora and Emma Smith as <a href="https://discuss.python.org/t/pre-pep-rust-for-cpython/104906" target="_blank" rel="noopener" class="mycode_url">authors of the Rust for CPython PEP draft</a>. Emma also <iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/42kibVnUHYE" frameborder="0" allowfullscreen="true"></iframe> about the Rust for CPython project. The team itself is around 60 developers in a Discord channel, among them a “few &#91;Python&#93; core developers” and a “delegation from the Rust project”. The team has experience with previous projects integrating Rust into existing codebases, such as Android and the Linux kernel, and is “excited by the work and keen to support &#91;the project&#93; if we proceed”.<br />
<br />
Why Rust?<br />
<br />
<img src="https://blog.python.org/_astro/type-crash.Dt_NIr5c_Z68UBs.webp" loading="lazy"  alt="[Image: type-crash.Dt_NIr5c_Z68UBs.webp]" class="mycode_img" /><br />
<br />
Showing how adopting Rust may specifically help CPython, David noted how the number of issues labeled with “<a href="https://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aopen%20label%3Atype-crash" target="_blank" rel="noopener" class="mycode_url"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>type-crash</code></div></div></a>” has been steadily rising over time. “We’ve been making some big technical bets”, he said, referencing the <a href="https://peps.python.org/pep-0617/" target="_blank" rel="noopener" class="mycode_url">new parser</a>, the <a href="https://peps.python.org/pep-0744/" target="_blank" rel="noopener" class="mycode_url">JIT</a>, and <a href="https://peps.python.org/pep-0703/" target="_blank" rel="noopener" class="mycode_url">free-threading</a>. These large, complex features may be one of the reasons more crash reports are being opened on GitHub, and Rust could be a potential solution here. David explained that Jeff Vander Stoep described Rust in Android as “move fast and fix things”, and that “fewer revisions for patches of the same size” was the experience Android has had since adopting Rust.<br />
<br />
Rust and Python are already working together in Python’s ecosystem of packages thanks to <a href="https://pyo3.rs" target="_blank" rel="noopener" class="mycode_url">PyO3</a> and <a href="https://pypi.org/project/maturin" target="_blank" rel="noopener" class="mycode_url">Maturin</a>. David also emphasized that many technology companies were “choosing Rust as a bet” instead of only as the new shiny tool.<br />
<br />
But adopting Rust into CPython would not all be smooth sailing; there were still concerns that David and the team are aware of.<br />
<br />
One of the biggest concerns from a year ago was Rust’s lack of platform support compared to CPython, which at the time of writing <a href="https://peps.python.org/pep-0011" target="_blank" rel="noopener" class="mycode_url">officially supports 20 different architectures and platforms</a> at either Tier 1, 2, or 3. David shared that Rust’s support of different platforms has “widened since last year” and was becoming “less and less of a concern”. The proposal would be to ask Python distributors to attempt using the optional Rust support in Python 3.16 (October 2027) and report platform-specific issues upstream in time to be resolved around the Python 3.17 timeline (October 2028).<br />
<br />
David acknowledged that adopting Rust into a project is a social challenge as much as a technical challenge. Rust knowledge is “not universal amongst core developers”, which would be partially mitigated by “targeting small portions” of CPython and an incremental approach, as “1 million lines of C code can’t be ported all at once”.<br />
<br />
David was clear that using Rust in itself does not necessarily mean that ported code would be free of bugs or security issues. Although Rust does mitigate classes of issues that commonly create bugs, the code can still have correctness issues. The team proposes mitigating this by adopting property-based testing, fuzzing, and using “prudent engineering practices” during the porting process.<br />
<br />
The proposed first Rust module: zlib<br />
<br />
Below are the proposed timelines for the Rust for CPython project making a “significant improvement” to CPython, with a PEP defining the success criteria for Rust expected in late 2026. Under this timeline, the first Rust code to ship in Python would be in Python 3.16, where it would be completely optional, with the existing C code kept as a fallback. The earliest that Rust would become required to build CPython is Python 3.18 in 2029, at least three years away.<br />
<br />
<img src="https://blog.python.org/_astro/timeline.SOw1vHVq_1rjKDh.webp" loading="lazy"  alt="[Image: timeline.SOw1vHVq_1rjKDh.webp]" class="mycode_img" /><br />
<br />
The timeline includes a build system and CI, Rust API proof-of-concept happening<br />
in the Summer 2026, a PEP defining success criteria in late 2026,<br />
an optional Rust backend for the zlib module and private Rust API in Python 3.16 (October 2027),<br />
resolving platform issues and Rust in more places (io, json, xml, memoryview, parser)<br />
for Python 3.17 (October 2028). Finally, in some distant Python version (October 2029+)<br />
the Rust build would be made required and a public Rust API would be published.<br />
<br />
The Rust for CPython team has selected the <a href="https://docs.python.org/3/library/zlib.html" target="_blank" rel="noopener" class="mycode_url">zlib module</a> as the first module to be given an optional Rust implementation because they “wanted to achieve a significant improvement” with a “small scope”. The proposed Rust implementation will use <a href="https://crates.io/crates/zlib-rs" target="_blank" rel="noopener" class="mycode_url">zlib-rs</a>, which is “heavily tested and used by the Firefox, uv, and <a href="https://doc.rust-lang.org/cargo/" target="_blank" rel="noopener" class="mycode_url">Cargo</a>” projects and “faster than zlib and zlib-ng on many platforms”. The module was also selected because it’d require using an external Cargo package, meaning this aspect of the build process would need to be designed and exercised.<br />
<br />
This small change would have an impact: the zlib compression algorithm is “widely used by Python packaging”, meaning that (almost) “every <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>pip install</code></div></div> in Python 3.16 will be sped up” if the proposal is accepted.<br />
<br />
Rust API Sketch<br />
<br />
David provided an example of some Rust code calling a hypothetical Rust API for Python. The API would use a Rust attribute (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#&#91;pyfunction&#93;</code></div></div>) and be similar to <a href="https://devguide.python.org/development-tools/clinic/" target="_blank" rel="noopener" class="mycode_url">Argument Clinic</a>, a development tool for automatically generating blocks of code for handling C function arguments from Pythonic function syntax. Rust functions would always be passed the thread and interpreter state (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Python&lt;'_&gt;</code></div></div>), use smart pointers around objects (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Py&lt;...&gt;</code></div></div>), and lean into Rust error handling with the <a href="https://doc.rust-lang.org/std/result/" target="_blank" rel="noopener" class="mycode_url"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Result</code></div></div></a> enum, returning either a result or an error that was raised.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]#&#91;pyfunction(signature = (
    data,
    /,
    wbits=MAX_WBITS,
    bufsize=DEF_BUF_SIZE,
))&#93;
fn decompress(
    py: Python&lt;'_&gt;,
    data: Py&lt;PyObject&gt;,
    wbits: c_int,
    bufsize: isize
) -&gt; PyResult&lt;Py&lt;PyBytes&gt;, PyErrRaised&gt; {

    // buf will be cleaned on scope exit
    let buf = PyObject::get_buffer(py, &amp;data)?;
    let decoded = /* ... */;

    Ok(PyBytes::new(py, &amp;decoded))
}[/code]</code></div></div><br />
The example above shows a buffer being allocated and automatically cleaned up on scope exit, rather than being cleaned up manually as would be required when writing the same function in C.<br />
<br />
Proposed success criteria<br />
<br />
David moved on to success criteria: what would the Rust for CPython project need to show to move into new phases of the roadmap and eventually become a required part of building CPython? “For previous big changes like the JIT and free-threading, we’ve explicitly defined success criteria that would need to be met in order for the added complexity to be accepted”, David explained, “we expect we’d need to do the same here. What should those criteria be?”<br />
<br />
David had these suggestions for core developers:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Critical:</span> A majority of active core developers are <span style="font-style: italic;" class="mycode_i">open</span> to using the Rust API to implement functionality.<br />
<br />
</li>
<li>No meaningful slowdown to CPython performance benchmarks.<br />
<br />
</li>
<li>All tiered platforms must be supported by Rust. The experience of distributors building CPython should generally indicate that adding Rust support is manageable.<br />
<br />
</li>
</ul>
<br />
David noted that the first point reads “open”, not “familiar”, and shared a plan to survey Python core developers about how they’ve used Rust while contributing to CPython when deciding whether to move Rust out of experimental stages.<br />
<br />
Discussion<br />
<br />
On the topic of designing the new Rust API so that it’s “familiar” to users of the C API, Thomas Wouters advised against “making compromises for the dinosaurs”, including himself in the subset, instead asking whether the Rust API should be designed from first principles. David responded that there are “places to lean into Rust”, such as dropping resources on scope exit, but there are also idiomatic Rust designs which “won’t be the best fit”. David noted that it would be reasonable for core developers to be looking at both the C and Rust API at the same time while working. “We should be mindful of our audience, which is also ourselves”.<br />
<br />
Larry Hastings asked why the Rust for CPython project wasn’t a “rewrite”, suggesting the team “display your success as a fork”. David acknowledged that “<a href="https://github.com/RustPython/RustPython" target="_blank" rel="noopener" class="mycode_url">RustPython</a> already exists” and that the Rust for CPython team had already spoken with the contributors of the project. “RustPython isn’t as performant as CPython, but could be used to inform what APIs we design”.<br />
<br />
Larry also shared that he “wasn’t super excited to learn Rust to work on CPython”. David assured him that there are many areas of CPython that would not be considered for writing in Rust: “CPython should not be written in Rust for the sake of Rust”. “CPython will be a dual-language project for a meaningful amount of time”. However, David cautioned that “it would be disingenuous to say that Rust would be optional forever”, as one of the aforementioned roadmap items for the Rust for CPython project is to become a required part of the build process and provide a public Rust API.<br />
<br />
<img src="https://blog.python.org/_astro/pablo.DKWOlIWN_Z1KSOmd.webp" loading="lazy"  alt="[Image: pablo.DKWOlIWN_Z1KSOmd.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Pablo Galindo Salgado was more concerned about the future, which was “reaching for our dependencies from Cargo”, noting that this would be a “huge problem” and a potential “showstopper” for the project. “We vendor our dependencies, and we have a very selective set”, he said, noting that each time a vulnerability is published for one of those projects, the release managers need to make new releases, which can be “tiresome”. “Right now we’re only focusing on the APIs and the basics”, he added, highlighting that the challenge of taking on many Rust dependencies hasn’t been addressed yet.<br />
<br />
David answered that the team should “select as few external dependencies as possible”; “zlib-rs is only one dependency”, and the Rust sources would be vendored so that “building CPython would not require Cargo”. David added that “Cargo has a relatively clean system for vendoring dependencies” and that the “Rust for CPython proof-of-concept uses this system”. The vendored sources “wouldn’t live in the CPython tree”. Łukasz Langa agreed that “it’s better for dependencies to live separately”, referencing the <a href="https://github.com/python/cpython-source-deps" target="_blank" rel="noopener" class="mycode_url">cpython-source-deps repository</a>, with Thomas reminding everyone that this would be a new usage of that repository; today it is only used for binary installers of CPython.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Memory Snapshots for CPython (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113542.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:04 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113542.html</guid>
			<description><![CDATA[If you open up a new Python interpreter, close it, and then open a new Python interpreter again… how different are these two processes? Hood Chatham’s talk at the Language Summit aimed to provide a safe alternate “bootstrapping” path for the Python interpreter that forgoes running the same initialization from scratch each time and instead uses a “snapshot” of the Python process memory after initialization has completed.<br />
<br />
<img src="https://blog.python.org/_astro/hood.BQ4EhlP7_Z1qhLvo.webp" loading="lazy"  alt="[Image: hood.BQ4EhlP7_Z1qhLvo.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
In tests of snapshots in <a href="https://pyodide.org/" target="_blank" rel="noopener" class="mycode_url">Pyodide</a>, executing a simple “Hello, world” program was around 4 times faster (0.353 seconds versus 1.406 seconds) when loading the Python interpreter from a memory snapshot compared to loading the Python interpreter from scratch without a snapshot. Node.js implemented V8 snapshots in v4.2.4 and saw ~33% improvements to startup time, but shortly after, in v4.8.4, snapshots were disabled due to the problem that Hood wanted to raise for discussion.<br />
<br />
Randomization where you don’t expect<br />
<br />
The issue was one that was familiar to Python and many other languages: <a href="https://ocert.org/advisories/ocert-2011-003.html" target="_blank" rel="noopener" class="mycode_url">denial-of-service through hash algorithm collisions</a>. This was a security issue reported to many programming languages at the same time, including Java, Ruby, PHP, and many other projects.<br />
<br />
Python fixed this issue in Python 3.3, as did many other programming languages, by adding a random <a href="https://docs.python.org/3/reference/datamodel.html#object.__hash__" target="_blank" rel="noopener" class="mycode_url">“salt” to hash() calculations</a>. The salt is randomized at program startup to prevent remote attackers from controlling the hash values of inputs, and thus causing a CPU denial-of-service by creating extremely unbalanced data structures that rely on object hash values being evenly distributed, like <a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries" target="_blank" rel="noopener" class="mycode_url">dict</a> and <a href="https://docs.python.org/3/tutorial/datastructures.html#sets" target="_blank" rel="noopener" class="mycode_url">set</a>.<br />
<br />
The danger of snapshotting and restoring the memory of a Python process post-initialization is captured by Randall Munroe’s <a href="https://xkcd.com/221/" target="_blank" rel="noopener" class="mycode_url">xkcd “Random Number”</a> (image below licensed CC-BY-NC 2.5), where the fixed value of “4” was at some indeterminate time in the past chosen by a fair dice roll and is now reused whenever a new random number is requested.<br />
<br />
<img src="https://blog.python.org/_astro/image.CqSKElGd_144qwf.webp" loading="lazy"  alt="[Image: image.CqSKElGd_144qwf.webp]" class="mycode_img" /><br />
<br />
If a Python process were to begin “restoring from a memory snapshot”, effectively this is what would happen for hash seed randomization: a value that is expected to be randomized every time would become deterministic and shared across all snapshots. Hood noted that there were likely other places, especially in libraries and programs, where this assumption would break existing use-cases, too.<br />
<br />
Hood proposed that the concept of an “initialization phase” be added to the Python language model, citing <a href="https://rpython.readthedocs.io/" target="_blank" rel="noopener" class="mycode_url">RPython</a> and <a href="https://github.com/spylang/spy" target="_blank" rel="noopener" class="mycode_url">SPy</a> as two runtimes that have introduced an “explicit entrypoint to an initialization phase”. These entry points were useful for tree-shaking and pre-evaluation, respectively, but could be reused for the purpose of fixing issues related to adding memory snapshots to CPython. This initialization phase could be called again on re-initialization, allowing the runtime and third-party libraries to safely reintroduce randomness into the program if memory snapshotting were implemented.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/room.BnIG3JAV_2hJkG4.webp" loading="lazy"  alt="[Image: room.BnIG3JAV_2hJkG4.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514669024/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Stefan Behnel referenced some similar functionality that Python already provides: the <a href="https://docs.python.org/3/library/atexit.html" target="_blank" rel="noopener" class="mycode_url">atexit module</a>, which provides an <a href="https://docs.python.org/3/library/atexit.html#atexit.register" target="_blank" rel="noopener" class="mycode_url">API for registering a callback function</a> that is called when the Python process is exiting. Stefan wondered whether a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>reinit</code></div></div> callback function could serve the needs Hood described.<br />
<br />
Peter Bierma wondered whether improvements to initialization time could speed up startup enough that snapshotting would no longer be needed. Hood answered that there’s a “ton of work” to do when initializing Python, such as importing modules, and that a proposal to speed up initialization is “an order of magnitude more complex” than memory snapshotting and reinitialization. “I know how to implement snapshotting, I don’t know how to speed up the interpreter”.<br />
<br />
Thomas Wouters wondered whether <a href="https://peps.python.org/pep-0810/" target="_blank" rel="noopener" class="mycode_url">lazy imports, defined in PEP 810</a> and coming to Python 3.15, would solve some of the issues with slow initialization. Hood was cautious, stating that lazy imports might make his specific use-case “worse before it gets better”, especially if memory snapshots were implemented for Python. Lazy imports mean that imported modules aren’t parsed and executed until a member of the module is accessed, so if an import isn’t required for a particular execution of a Python program, then its cost isn’t paid by the interpreter.<br />
<br />
Snapshots, however, benefit performance because the cost to parse and execute all imports is paid a single time, the state is saved, and then it is “restored” in future executions to skip this part of the process. If imports aren’t resolved initially (such as when lazy imports are used), then the imports won’t be saved in the snapshot, and their cost will be paid on each Python execution, even if memory snapshots are implemented.<br />
<br />
Hood also shared some details about the use-case he was interested in: using Python with <a href="https://webassembly.org/" target="_blank" rel="noopener" class="mycode_url">WebAssembly</a> and edge compute services. Edge compute services don’t necessarily have access to a filesystem at runtime, which lazy imports would require.<br />
<br />
The conversation switched to <a href="https://docs.python.org/3/using/cmdline.html#cmdoption-X" target="_blank" rel="noopener" class="mycode_url">freezing modules</a>. Pablo Galindo Salgado referenced some prior art at Alibaba for snapshots using a “memory dump and metadata table”. Guido van Rossum, speaking from experience on the Faster CPython team, noted that deep-freezing modules “didn’t affect startup that much” while adding complexity, and so “wasn’t worth it” from the team’s perspective. The team “didn’t spend much time trying to figure out why” this didn’t affect startup times.<br />
<br />
Eric Snow added that another approach considered was freezing the memory of objects and introducing a “form of copy-on-write (COW)”, acknowledging that many objects aren’t going to change, so copying data can be avoided.]]></description>
			<content:encoded><![CDATA[If you open up a new Python interpreter, close it, and then open a new Python interpreter again… how different are these two processes? Hood Chatham’s talk at the Language Summit aimed to provide a safe alternate “bootstrapping” path for the Python interpreter that forgoes running the same initialization from scratch each time and instead uses a “snapshot” of the Python process memory after initialization has completed.<br />
<br />
<img src="https://blog.python.org/_astro/hood.BQ4EhlP7_Z1qhLvo.webp" loading="lazy"  alt="[Image: hood.BQ4EhlP7_Z1qhLvo.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
In tests of snapshots in <a href="https://pyodide.org/" target="_blank" rel="noopener" class="mycode_url">Pyodide</a>, executing a simple “Hello, world” program was around 4 times faster (0.353 seconds versus 1.406 seconds) when loading the Python interpreter from a memory snapshot compared to loading the Python interpreter from scratch without a snapshot. Node.js implemented V8 snapshots in v4.2.4 and saw ~33% improvements to startup time, but shortly after, in v4.8.4, snapshots were disabled due to the problem that Hood wanted to raise for discussion.<br />
<br />
Randomization where you don’t expect<br />
<br />
The issue was one that was familiar to Python and many other languages: <a href="https://ocert.org/advisories/ocert-2011-003.html" target="_blank" rel="noopener" class="mycode_url">denial-of-service through hash algorithm collisions</a>. This was a security issue reported to many programming languages at the same time, including Java, Ruby, PHP, and many other projects.<br />
<br />
Python fixed this issue in Python 3.3, as did many other programming languages, by adding a random <a href="https://docs.python.org/3/reference/datamodel.html#object.__hash__" target="_blank" rel="noopener" class="mycode_url">“salt” to hash() calculations</a>. The salt is randomized at program startup to prevent remote attackers from controlling the hash values of inputs, and thus causing a CPU denial-of-service by creating extremely unbalanced data structures that rely on object hash values being evenly distributed, like <a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries" target="_blank" rel="noopener" class="mycode_url">dict</a> and <a href="https://docs.python.org/3/tutorial/datastructures.html#sets" target="_blank" rel="noopener" class="mycode_url">set</a>.<br />
<br />
The danger of snapshotting and restoring the memory of a Python process post-initialization is captured by Randall Munroe’s <a href="https://xkcd.com/221/" target="_blank" rel="noopener" class="mycode_url">xkcd “Random Number”</a> (image below licensed CC-BY-NC 2.5), where the fixed value of “4” was at some indeterminate time in the past chosen by a fair dice roll and is now reused whenever a new random number is requested.<br />
<br />
<img src="https://blog.python.org/_astro/image.CqSKElGd_144qwf.webp" loading="lazy"  alt="[Image: image.CqSKElGd_144qwf.webp]" class="mycode_img" /><br />
<br />
If a Python process were to begin “restoring from a memory snapshot”, effectively this is what would happen for hash seed randomization: a value that is expected to be randomized every time would become deterministic and shared across all snapshots. Hood noted that there were likely other places, especially in libraries and programs, where this assumption would break existing use-cases, too.<br />
<br />
Hood proposed that the concept of an “initialization phase” be added to the Python language model, citing <a href="https://rpython.readthedocs.io/" target="_blank" rel="noopener" class="mycode_url">RPython</a> and <a href="https://github.com/spylang/spy" target="_blank" rel="noopener" class="mycode_url">SPy</a> as two runtimes that have introduced an “explicit entrypoint to an initialization phase”. These entry points were useful for tree-shaking and pre-evaluation, respectively, but could be reused for the purpose of fixing issues related to adding memory snapshots to CPython. This initialization phase could be called again on re-initialization, allowing the runtime and third-party libraries to safely reintroduce randomness into the program if memory snapshotting were implemented.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/room.BnIG3JAV_2hJkG4.webp" loading="lazy"  alt="[Image: room.BnIG3JAV_2hJkG4.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514669024/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Stefan Behnel referenced some similar functionality that Python already provides: the <a href="https://docs.python.org/3/library/atexit.html" target="_blank" rel="noopener" class="mycode_url">atexit module</a>, which provides an <a href="https://docs.python.org/3/library/atexit.html#atexit.register" target="_blank" rel="noopener" class="mycode_url">API for registering a callback function</a> that is called when the Python process is exiting. Stefan wondered whether a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>reinit</code></div></div> callback function could serve the needs Hood described.<br />
<br />
Peter Bierma wondered whether improvements to initialization time could speed up startup enough that snapshotting would no longer be needed. Hood answered that there’s a “ton of work” to do when initializing Python, such as importing modules, and that a proposal to speed up initialization is “an order of magnitude more complex” than memory snapshotting and reinitialization. “I know how to implement snapshotting, I don’t know how to speed up the interpreter”.<br />
<br />
Thomas Wouters wondered whether <a href="https://peps.python.org/pep-0810/" target="_blank" rel="noopener" class="mycode_url">lazy imports, defined in PEP 810</a> and coming to Python 3.15, would solve some of the issues with slow initialization. Hood was cautious, stating that lazy imports might make his specific use-case “worse before it gets better”, especially if memory snapshots were implemented for Python. Lazy imports mean that imported modules aren’t parsed and executed until a member of the module is accessed, so if an import isn’t required for a particular execution of a Python program, then its cost isn’t paid by the interpreter.<br />
<br />
Snapshots, however, benefit performance because the cost to parse and execute all imports is paid a single time, the state is saved, and then it is “restored” in future executions to skip this part of the process. If imports aren’t resolved initially (such as when lazy imports are used), then the imports won’t be saved in the snapshot, and their cost will be paid on each Python execution, even if memory snapshots are implemented.<br />
<br />
Hood also shared some details about the use-case he was interested in: using Python with <a href="https://webassembly.org/" target="_blank" rel="noopener" class="mycode_url">WebAssembly</a> and edge compute services. Edge compute services don’t necessarily have access to a filesystem at runtime, which lazy imports would require.<br />
<br />
The conversation switched to <a href="https://docs.python.org/3/using/cmdline.html#cmdoption-X" target="_blank" rel="noopener" class="mycode_url">freezing modules</a>. Pablo Galindo Salgado referenced some prior art at Alibaba for snapshots using a “memory dump and metadata table”. Guido van Rossum, speaking from experience on the Faster CPython team, noted that deep-freezing modules “didn’t affect startup that much” while adding complexity, and so “wasn’t worth it” from the team’s perspective. The team “didn’t spend much time trying to figure out why” this didn’t affect startup times.<br />
<br />
Eric Snow added that another approach considered was freezing the memory of objects and introducing a “form of copy-on-write (COW)”, acknowledging that many objects aren’t going to change, so copying data can be avoided.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Py Blog] Memory Buffer Protocol (Python Language Summit 2026)]]></title>
			<link>https://sickgaming.net/thread-113513.html</link>
			<pubDate>Wed, 30 Sep 2026 10:00:03 -0200</pubDate>
			<dc:creator><![CDATA[<a href="https://sickgaming.net/member.php?action=profile&uid=12">xSicKxBot</a>]]></dc:creator>
			<guid isPermaLink="false">https://sickgaming.net/thread-113513.html</guid>
			<description><![CDATA[The <a href="https://docs.python.org/3/c-api/buffer.html" target="_blank" rel="noopener" class="mycode_url">Python Buffer Protocol</a> defines the semantics for accessing the underlying memory buffer of Python objects such as <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bytes</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bytearray</code></div></div>, and other types like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>array.array</code></div></div>. The Python Buffer Protocol allows accessing an implementing object’s underlying memory directly, rather than only through higher-level APIs, which improves performance.<br />
<br />
<img src="https://blog.python.org/_astro/nathan.DDlK5pWY_Z28lD3m.webp" loading="lazy"  alt="[Image: nathan.DDlK5pWY_Z28lD3m.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Documenting the Buffer Protocol<br />
<br />
Nathan Goldbaum opened with some suggestions that were unlikely to be controversial, like improving the documentation and making the Buffer Protocol specification less fragmented. Buffers support a “struct-style” language that is similar to, but much more featureful than, Python’s <a href="https://docs.python.org/3/library/struct.html#format-strings" target="_blank" rel="noopener" class="mycode_url">struct format strings</a>. “There are corners of the format language that are underspecified”.<br />
<br />
<img src="https://blog.python.org/_astro/image.BjJmgGyZ_1kNK6K.webp" loading="lazy"  alt="[Image: image.BjJmgGyZ_1kNK6K.webp]" class="mycode_img" /><br />
<br />
Today, users are expected to read <a href="https://peps.python.org/pep-3118/" target="_blank" rel="noopener" class="mycode_url">PEP 3118</a> or implementations like <a href="https://numpy.org" target="_blank" rel="noopener" class="mycode_url">NumPy</a> to understand the full grammar, “including records, field names, subarrays, byte order, alignment, and complex numbers”. Documenting all features within the Python documentation would be a meaningful improvement.<br />
<br />
Continuing with helping consumers of the Buffer Protocol, Nathan proposed creating a HOWTO guide for exporters and consumers of the Buffer Protocol, citing a lack of “complete examples” in C that implement validation, cleanup, ownership, and safe use of threads.<br />
<br />
Safe concurrency<br />
<br />
Nathan was primarily looking for feedback on the upcoming sections of the talk, for which there are drafted PEPs addressing two shortcomings of the Buffer Protocol: <a href="https://github.com/ngoldbaum/peps/blob/stable-views/peps/pep-9999.rst" target="_blank" rel="noopener" class="mycode_url">coordinating concurrent reads and writes</a> and <a href="https://hackmd.io/@seberg/r1zB-s3tJl" target="_blank" rel="noopener" class="mycode_url">custom data types</a>.<br />
<br />
The first issue was that the Python Buffer Protocol “didn’t support read and write coordination at the protocol level”. Storage addresses were stable, but contents were not. The Buffer Protocol supports a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>readonly</code></div></div> attribute, but this value only applies to a single view, and writable access could not be made exclusive with existing APIs.<br />
<br />
Nathan’s proposal to add safe coordination of reads and writes was through new buffer “leasing” C APIs, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBufferLease</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBufferAccessState</code></div></div>, similar to <a href="https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html" target="_blank" rel="noopener" class="mycode_url">Rust’s borrowing mechanism</a>. These APIs would allow consumers to lease a buffer and declare their access pattern ahead of accessing a buffer view. Below is an example of how these new APIs would be used:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]PyBufferLease *lease = PyObject_AcquireBufferLease(obj,
                                                   PyBUF_CONTIG_RO,
                                                   Py_BUFFER_ACCESS_SHARED_READ);

if (lease == NULL) {
    return -1;
}

const Py_buffer *view = PyBufferLease_GetView(lease);

Py_BEGIN_ALLOW_THREADS
consume_bytes(view-&gt;buf, view-&gt;len);
Py_END_ALLOW_THREADS

PyBufferLease_Release(lease);[/code]</code></div></div><br />
Leases could be opened in either <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SHARED_READ</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div> mode, and calling <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_AcquireBufferLease()</code></div></div> would not block, instead immediately either succeeding or failing if an incompatible lease already exists. <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div> would provide writable access and exclude every other access to overlapping memory.<br />
<br />
<img src="https://blog.python.org/_astro/compat.BuV5XD0f_ZLiCbh.webp" loading="lazy"  alt="[Image: compat.BuV5XD0f_ZLiCbh.webp]" class="mycode_img" /><br />
<br />
The existing <a href="https://docs.python.org/3/c-api/buffer.html#c.PyObject_GetBuffer" target="_blank" rel="noopener" class="mycode_url">PyObject_GetBuffer()</a>, <a href="https://docs.python.org/3/c-api/buffer.html#c.PyBuffer_Release" target="_blank" rel="noopener" class="mycode_url">PyBuffer_Release()</a>, and other related interfaces would remain unchanged under Nathan’s proposal. Buffer exporters would advertise explicit support for the new access modes, and exporters that don’t support the new access APIs would continue to use existing APIs as-is. Consumers would query the exporter using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_GetBufferAccessModes()</code></div></div> and use a lease if the desired access mode is available from the exporter.<br />
<br />
There is already an implementation being <a href="https://github.com/kumaraditya303/numpy/tree/view-tracking" target="_blank" rel="noopener" class="mycode_url">worked on that is similar to this proposal</a>. Kumar Aditya is working on changes to NumPy allowing interoperability with the PEP, but Nathan noted that NumPy allowing access to raw pointers presented an “interesting” challenge.<br />
<br />
Nathan <a href="https://github.com/ngoldbaum/peps/blob/stable-views/peps/pep-9999.rst" target="_blank" rel="noopener" class="mycode_url">published his PEP draft</a>, is requesting feedback, and will open a PEP discussion soon.<br />
<br />
Custom Data Types<br />
<br />
Finally, Nathan detailed a proposal that he and Sebastian Berg created that would add an extension point to the Buffer Protocol for custom data types. Today the Buffer Protocol format has a “fixed vocabulary”, meaning that to support custom data types, third parties either need to land a new type and format code in Python or use “out-of-band signaling and convention”. Instead of needing to block new types and format codes on a decision from the Python Steering Council, a namespace-based approach to custom data types could be used.<br />
<br />
In this proposed extension, a custom data type would be defined with square brackets (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#91;&#93;</code></div></div>) with a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;</code></div></div> character delimiting the library namespace from the data type. Implementations that support the definition could then interpret known custom data types safely and reject any unknown custom data types without parsing the buffer.<br />
<br />
Nathan pointed to a discussion on <a href="https://discuss.python.org/t/buffer-protocol-and-arbitrary-data-types/26256/13" target="_blank" rel="noopener" class="mycode_url">discuss.python.org</a> and the <a href="https://hackmd.io/@seberg/r1zB-s3tJl" target="_blank" rel="noopener" class="mycode_url">draft PEP</a> for this proposal.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/discussion.CgtYH1Qu_ZWFO5z.webp" loading="lazy"  alt="[Image: discussion.CgtYH1Qu_ZWFO5z.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514661234/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Petr Viktorin asked whether a new API was needed for this proposal or whether the existing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_GetBuffer()</code></div></div> API could be extended. Nathan didn’t think the existing API, which is a part of Python’s <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a> and therefore can’t be changed, had enough space for a new field. “There’s an internal field, but it’s documented as being used by exporters, so we can’t use that one”. “We can’t smuggle information in the struct, we’d need a new struct to hold that information.”<br />
<br />
Thomas Wouters asked how Nathan’s proposal compares to Rust: when asking for exclusive write access, should the request block or error out? Nathan replied that erroring out would be the simplest implementation. David Hewitt asked about the composability of the implementation, and whether it could accommodate additional, likely desirable features like “blocking, asynchronously blocking, or more complicated structures like writing to slices”.<br />
<br />
Larry Hastings wondered whether this new API assumes that users are being diligent and using the API correctly. Nathan confirmed that memory corruption would be possible if the APIs were used incorrectly, but that pure-Python users wouldn’t be able to do this, only authors of <a href="https://docs.python.org/3/extending/index.html" target="_blank" rel="noopener" class="mycode_url">C extensions</a>. Leaking memory wouldn’t be possible.<br />
<br />
<img src="https://blog.python.org/_astro/hood.CowsNj6T_Z1GTNO.webp" loading="lazy"  alt="[Image: hood.CowsNj6T_Z1GTNO.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Hood Chatham asked whether buffer exporters would be allowed to reject consumers using the old buffer access pattern without specifying either <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SHARED_READ</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div>. Doing this would enable using a Rust buffer as the backing storage.]]></description>
			<content:encoded><![CDATA[The <a href="https://docs.python.org/3/c-api/buffer.html" target="_blank" rel="noopener" class="mycode_url">Python Buffer Protocol</a> defines the semantics for accessing the underlying memory buffer of Python objects such as <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bytes</code></div></div>, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bytearray</code></div></div>, and other types like <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>array.array</code></div></div>. The Python Buffer Protocol allows accessing an implementing object’s underlying memory directly, rather than only through higher-level APIs, which improves performance.<br />
<br />
<img src="https://blog.python.org/_astro/nathan.DDlK5pWY_Z28lD3m.webp" loading="lazy"  alt="[Image: nathan.DDlK5pWY_Z28lD3m.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Documenting the Buffer Protocol<br />
<br />
Nathan Goldbaum opened with some suggestions that were unlikely to be controversial, like improving the documentation and making the Buffer Protocol specification less fragmented. Buffers support a “struct-style” language that is similar to, but much more featureful than, Python’s <a href="https://docs.python.org/3/library/struct.html#format-strings" target="_blank" rel="noopener" class="mycode_url">struct format strings</a>. “There are corners of the format language that are underspecified”.<br />
<br />
<img src="https://blog.python.org/_astro/image.BjJmgGyZ_1kNK6K.webp" loading="lazy"  alt="[Image: image.BjJmgGyZ_1kNK6K.webp]" class="mycode_img" /><br />
<br />
Today, users are expected to read <a href="https://peps.python.org/pep-3118/" target="_blank" rel="noopener" class="mycode_url">PEP 3118</a> or implementations like <a href="https://numpy.org" target="_blank" rel="noopener" class="mycode_url">NumPy</a> to understand the full grammar, “including records, field names, subarrays, byte order, alignment, and complex numbers”. Documenting all features within the Python documentation would be a meaningful improvement.<br />
<br />
Continuing with helping consumers of the Buffer Protocol, Nathan proposed creating a HOWTO guide for exporters and consumers of the Buffer Protocol, citing a lack of “complete examples” in C that implement validation, cleanup, ownership, and safe use of threads.<br />
<br />
Safe concurrency<br />
<br />
Nathan was primarily looking for feedback on the upcoming sections of the talk, for which there are drafted PEPs addressing two shortcomings of the Buffer Protocol: <a href="https://github.com/ngoldbaum/peps/blob/stable-views/peps/pep-9999.rst" target="_blank" rel="noopener" class="mycode_url">coordinating concurrent reads and writes</a> and <a href="https://hackmd.io/@seberg/r1zB-s3tJl" target="_blank" rel="noopener" class="mycode_url">custom data types</a>.<br />
<br />
The first issue was that the Python Buffer Protocol “didn’t support read and write coordination at the protocol level”. Storage addresses were stable, but contents were not. The Buffer Protocol supports a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>readonly</code></div></div> attribute, but this value only applies to a single view, and writable access could not be made exclusive with existing APIs.<br />
<br />
Nathan’s proposal to add safe coordination of reads and writes was through new buffer “leasing” C APIs, <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBufferLease</code></div></div> and <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyBufferAccessState</code></div></div>, similar to <a href="https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html" target="_blank" rel="noopener" class="mycode_url">Rust’s borrowing mechanism</a>. These APIs would allow consumers to lease a buffer and declare their access pattern ahead of accessing a buffer view. Below is an example of how these new APIs would be used:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[code]PyBufferLease *lease = PyObject_AcquireBufferLease(obj,
                                                   PyBUF_CONTIG_RO,
                                                   Py_BUFFER_ACCESS_SHARED_READ);

if (lease == NULL) {
    return -1;
}

const Py_buffer *view = PyBufferLease_GetView(lease);

Py_BEGIN_ALLOW_THREADS
consume_bytes(view-&gt;buf, view-&gt;len);
Py_END_ALLOW_THREADS

PyBufferLease_Release(lease);[/code]</code></div></div><br />
Leases could be opened in either <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SHARED_READ</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div> mode, and calling <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_AcquireBufferLease()</code></div></div> would not block, instead immediately either succeeding or failing if an incompatible lease already exists. <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div> would provide writable access and exclude every other access to overlapping memory.<br />
<br />
<img src="https://blog.python.org/_astro/compat.BuV5XD0f_ZLiCbh.webp" loading="lazy"  alt="[Image: compat.BuV5XD0f_ZLiCbh.webp]" class="mycode_img" /><br />
<br />
The existing <a href="https://docs.python.org/3/c-api/buffer.html#c.PyObject_GetBuffer" target="_blank" rel="noopener" class="mycode_url">PyObject_GetBuffer()</a>, <a href="https://docs.python.org/3/c-api/buffer.html#c.PyBuffer_Release" target="_blank" rel="noopener" class="mycode_url">PyBuffer_Release()</a>, and other related interfaces would remain unchanged under Nathan’s proposal. Buffer exporters would advertise explicit support for the new access modes, and exporters that don’t support the new access APIs would continue to use existing APIs as-is. Consumers would query the exporter using <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_GetBufferAccessModes()</code></div></div> and use a lease if the desired access mode is available from the exporter.<br />
<br />
There is already an implementation being <a href="https://github.com/kumaraditya303/numpy/tree/view-tracking" target="_blank" rel="noopener" class="mycode_url">worked on that is similar to this proposal</a>. Kumar Aditya is working on changes to NumPy allowing interoperability with the PEP, but Nathan noted that NumPy allowing access to raw pointers presented an “interesting” challenge.<br />
<br />
Nathan <a href="https://github.com/ngoldbaum/peps/blob/stable-views/peps/pep-9999.rst" target="_blank" rel="noopener" class="mycode_url">published his PEP draft</a>, is requesting feedback, and will open a PEP discussion soon.<br />
<br />
Custom Data Types<br />
<br />
Finally, Nathan detailed a proposal that he and Sebastian Berg created that would add an extension point to the Buffer Protocol for custom data types. Today the Buffer Protocol format has a “fixed vocabulary”, meaning that to support custom data types, third parties either need to land a new type and format code in Python or use “out-of-band signaling and convention”. Instead of needing to block new types and format codes on a decision from the Python Steering Council, a namespace-based approach to custom data types could be used.<br />
<br />
In this proposed extension, a custom data type would be defined with square brackets (<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#91;&#93;</code></div></div>) with a <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;</code></div></div> character delimiting the library namespace from the data type. Implementations that support the definition could then interpret known custom data types safely and reject any unknown custom data types without parsing the buffer.<br />
<br />
Nathan pointed to a discussion on <a href="https://discuss.python.org/t/buffer-protocol-and-arbitrary-data-types/26256/13" target="_blank" rel="noopener" class="mycode_url">discuss.python.org</a> and the <a href="https://hackmd.io/@seberg/r1zB-s3tJl" target="_blank" rel="noopener" class="mycode_url">draft PEP</a> for this proposal.<br />
<br />
Discussion<br />
<br />
<img src="https://blog.python.org/_astro/discussion.CgtYH1Qu_ZWFO5z.webp" loading="lazy"  alt="[Image: discussion.CgtYH1Qu_ZWFO5z.webp]" class="mycode_img" /><br />
<br />
Photo by <a href="https://www.flickr.com/photos/europython/55514661234/" target="_blank" rel="noopener" class="mycode_url">EuroPython</a> (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Petr Viktorin asked whether a new API was needed for this proposal or whether the existing <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>PyObject_GetBuffer()</code></div></div> API could be extended. Nathan didn’t think the existing API, which is a part of Python’s <a href="https://docs.python.org/3/c-api/stable.html" target="_blank" rel="noopener" class="mycode_url">Stable ABI</a> and therefore can’t be changed, had enough space for a new field. “There’s an internal field, but it’s documented as being used by exporters, so we can’t use that one”. “We can’t smuggle information in the struct, we’d need a new struct to hold that information.”<br />
<br />
Thomas Wouters asked how Nathan’s proposal compares to Rust: when asking for exclusive write access, should the request block or error out? Nathan replied that erroring out would be the simplest implementation. David Hewitt asked about the composability of the implementation, and whether it could accommodate additional, likely desirable features like “blocking, asynchronously blocking, or more complicated structures like writing to slices”.<br />
<br />
Larry Hastings wondered whether this new API assumes that users are being diligent and using the API correctly. Nathan confirmed that memory corruption would be possible if the APIs were used incorrectly, but that pure-Python users wouldn’t be able to do this, only authors of <a href="https://docs.python.org/3/extending/index.html" target="_blank" rel="noopener" class="mycode_url">C extensions</a>. Leaking memory wouldn’t be possible.<br />
<br />
<img src="https://blog.python.org/_astro/hood.CowsNj6T_Z1GTNO.webp" loading="lazy"  alt="[Image: hood.CowsNj6T_Z1GTNO.webp]" class="mycode_img" /><br />
<br />
Photo by Hugo van Kemenade (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" class="mycode_url">CC BY-NC-SA 4.0</a>)<br />
<br />
Hood Chatham asked whether buffer exporters would be allowed to reject consumers using the old buffer access pattern without specifying either <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SHARED_READ</code></div></div> or <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>EXCLUSIVE_WRITE</code></div></div>. Doing this would enable using a Rust buffer as the backing storage.]]></content:encoded>
		</item>
	</channel>
</rss>