{"id":49796,"date":"2025-10-08T16:09:29","date_gmt":"2025-10-08T16:09:29","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=49796"},"modified":"2025-10-09T11:07:35","modified_gmt":"2025-10-09T11:07:35","slug":"python-3-14-free-threading-zstandard","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2025\/10\/python-3-14-free-threading-zstandard\/","title":{"rendered":"Python 3.14 Released with Free-threading &#038; Template string literals"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-49797\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/python314-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Python announced the new 3.14 version yesterday! See what&#8217;s new and how to install guide for Ubuntu users.<\/p>\n<p>Python 3.14 is the latest stable release of the Python programming language, with 5 years support until 2030.<\/p>\n<p>Since the release, the <strong>free-threaded build of Python<\/strong> is officially supported and no longer experimental. It&#8217;s so far optional, though will be make default in next phase.<\/p>\n<p><!--more--><\/p>\n<p>In Python 3.14, the <strong>evaluation of annotations is now deferred<\/strong>. It introduced the new <code>annotationlib<\/code> module, providing tools for inspecting deferred annotations. And, annotations may be evaluated in the VALUE format, the FORWARDREF format, and the STRING format. See <a href=\"https:\/\/peps.python.org\/pep-0649\/\" target=\"_blank\" rel=\"noopener\">PEP 649<\/a> for more.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49798\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749-700x508.webp\" alt=\"\" width=\"610\" height=\"443\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749-700x508.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749-300x218.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749-768x557.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-pep749.webp 891w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>It added <strong>Template string literals<\/strong> (<a href=\"https:\/\/peps.python.org\/pep-0750\/\" target=\"_blank\" rel=\"noopener\">PEP 750<\/a>), new mechanism for custom string processing. The new <code>t-strings<\/code> use the familiar syntax of f-strings, but return an object representing the static and interpolated parts of the string.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49799\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings-700x443.webp\" alt=\"\" width=\"610\" height=\"386\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings-700x443.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings-300x190.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings-768x486.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-tstrings.webp 891w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Python 3.14 finally added multiple interpreters in the standard library (<a href=\"https:\/\/peps.python.org\/pep-0734\/\" target=\"_blank\" rel=\"noopener\">PEP 734<\/a>). With the new <code>concurrent.interpreters<\/code> module, it now supports running multiple copies of Python in the same process simultaneously without C-API.<\/p>\n<p>It as well introduced new <code>compression<\/code> package contains <code>compression.lzma<\/code>, <code>compression.bz2<\/code>, <code>compression.gzip<\/code>, <code>compression.zlib<\/code>, as well as <code>compression.zstd<\/code> modules.<\/p>\n<p>Besides compression and decompression for the Zstandard format (<a href=\"https:\/\/peps.python.org\/pep-0784\/\" target=\"_blank\" rel=\"noopener\">PEP 784<\/a>), the support for reading and writing Zstandard compressed archives has been added to the <code>tarfile<\/code>, <code>zipfile<\/code>, and <code>shutil<\/code> modules.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49800\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd-700x443.webp\" alt=\"\" width=\"610\" height=\"386\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd-700x443.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd-300x190.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd-768x486.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/10\/py314-zstd.webp 891w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>The release also introduced a zero-overhead debugging interface for CPython, that allows debuggers and profilers to safely attach to running Python processes without stopping or restarting them.<\/p>\n<p>A new command-line interface is added to inspect running Python processes using asynchronous tasks, available via <code>python -m asyncio ps PID<\/code> or <code>python -m asyncio pstree PID<\/code>.<\/p>\n<p>And the <code>pdb<\/code> module now supports remote attaching to a running Python process using a new <code>-p PID<\/code> command-line option. For example, run <code>python -m pdb -p 1234<\/code> will connect to the Python process with the given PID and allow you to debug it interactively.<\/p>\n<p>Other changes include:<\/p>\n<ul>\n<li>PEP 758: Allow <code>except<\/code> and <code>except*<\/code> expressions without brackets.<\/li>\n<li>PEP 765: Disallow return\/break\/continue that exit a finally block.<\/li>\n<li>PEP 741: Add a C API to configure the Python initialization without relying on C structures and the ability to make ABI-compatible changes in the future.<\/li>\n<li>Syntax highlighting in PyREPL, and support for color in unittest, argparse, json and calendar CLIs.<\/li>\n<li>UUID versions 6-8 are now supported by the uuid module, and generation of versions 3-5 are up to 40% faster.<\/li>\n<li>Add a new type of interpreter to CPython, which provides significantly better performance for certain newer compilers.<\/li>\n<li>Add a built-in implementation for HMAC (RFC 2104) using formally verified code from the HACL* project.<\/li>\n<li>Improve error messages, and more.<\/li>\n<\/ul>\n<p>For more details about Python 3.14, see the <a href=\"https:\/\/docs.python.org\/3.14\/whatsnew\/3.14.html\" target=\"_blank\" rel=\"noopener\">official docs<\/a>.<\/p>\n<h3>Install Python 3.14<\/h3>\n<p>The source tarball for Python 3.14 is available to download via the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/www.python.org\/ftp\/python\/\" target=\"_blank\" rel=\"noreferrer noopener\">Download Python<\/a><\/div>\n<\/div>\n<p>Ubuntu has made Python 3.14 in system repository in 25.10. For Ubuntu 22.04 and Ubuntu 24.04, the popular <a href=\"https:\/\/launchpad.net\/~deadsnakes\/+archive\/ubuntu\/ppa\" target=\"_blank\" rel=\"noopener\">Deadsnakes PPA<\/a> has been updated with the package for the 2 LTS releases.<\/p>\n<p>To add the PPA and install the package, run commands below one by one:<\/p>\n<pre>sudo add-apt-repository ppa:deadsnakes\/ppa\r\nsudo apt update\r\nsudo apt install python3.14-full<\/pre>\n<p>For other Ubuntu releases, it&#8217;s not hard to build from source. And, I&#8217;ve written a <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2025\/05\/install-python-3-14-ubuntu\/\" target=\"_blank\" rel=\"noopener\">step by step guide<\/a> for all current Ubuntu releases.<\/p>","protected":false},"excerpt":{"rendered":"<p>Python announced the new 3.14 version yesterday! See what&#8217;s new and how to install guide for Ubuntu users. Python 3.14 is the latest stable release of the Python programming language, with 5 years support until 2030. Since the release, the free-threaded build of Python is officially supported and no longer experimental. It&#8217;s so far optional, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":49797,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[2086,2045],"class_list":["post-49796","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-programming","tag-python"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/49796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=49796"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/49796\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/49797"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=49796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=49796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=49796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}