Python's latest major version, 3.12, has been released! It includes many new features and optimizations, and several articles in this issue of the Weekly cover them. (Also see: A Closer Look at Python 3.12's New Features)
TL;DR
Python 3.12.0 is officially out! Quick tours cover subinterpreters, native perf support and static typing upgrades, plus a supply-chain security take and eBPF-powered profiling.
Articles & Tutorials
× 12What are Python subinterpreters? What does PEP-684 in version 3.12 do? What changes might we see in version 3.13?
This article introduces the basic knowledge of Python stack frames, the implementation of trace and perf before 3.12, and the implementation of the new Linux native perf introduced in 3.12.
Version 3.12 brings several adjustments and improvements: type variables to annotate generic classes and functions, new syntax for type variables, use of the new @override decorator for model inheritance, and more precise annotation of **kwargs with TypedDict.
Dependency injection is a powerful design pattern. How can we use dependency injection in FastAPI to build maintainable and high-performance web applications? The content includes: dependency injection for managing configuration, dependency injection for database access and ORM, advanced dependency injection techniques, testing dependency injection, dependency injection for performance optimization and caching, security and dependency injection, etc.
This article introduces the usage examples and principles of closures, and mainly discusses how function closures are implemented at the virtual machine level.
Pexpect is a library for automating interactive applications such as ssh, ftp, passwd, telnet, and more, with 2.4K stars on Github. This article introduces the usage of its expect_list method.
This blog post introduces the textual-plotext library, which allows you to plot using Plotext in the terminal.
A series of blog posts from the BBC R&D Cloudfit team, the Asyncio series has been updated with 5 articles covering fundamental concepts and patterns, asynchronous context managers and iterators, library support, and mixing async and sync code.
Using eBPF to read abstract stack data from memory structures, enabling stack traces and analysis of code execution.
The article covers less-publicized changes in version 3.12: improvements to the pathlib library, a better debugging experience, slice objects are now hashable, the surprise appearance of math.sumprod(), and a new command-line interface.
What is the release process for Python versions? What are some areas for improvement in the way versions are built? The article also covers using a Software Bill of Materials (SBOM) to track the subcomponents of a software distribution and how they change between versions.
🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).
Projects & Resources
× 12A non-profit, ad-free, and free search engine that focuses on usability and speed. It's currently a proof of concept and has a small index of pages. (1K stars)
Enterprise Q&A over structured data, allowing to set up an API to answer questions in plain English.
A framework for solving high-level tasks with language models (LMs) and retrieval models (RMs). It unifies techniques for prompting and fine-tuning LMs, as well as methods for inference, self-improvement, and augmentation with retrieval and tools. (3.5k stars)
A library for state-of-the-art text-to-speech generation, with pretrained models in 1100 languages, and the ability to train new models and fine-tune existing ones for any language. (20.3k stars)
A general-purpose Python graphics library written in Rust, featuring high performance and safety.
A framework for building asynchronous services that interact with event streams like Apache Kafka, RabbitMQ, and NATS, simplifying the process of writing producers and consumers for message queues.
A popular asynchronous HTTP framework, whose main features include: support for HTTP protocol on both client and server sides, Websocket out of the box, support for middleware and pluggable routing. (14k stars)
A web framework based on Python 3.11, featuring an Object-Document-Mapper (ODM) for document-oriented databases, Websocket support, a caching API, built-in authentication and authorization classes, customizable middleware, visual API monitoring, and more.
Could quantum computers be as easy to use as a laptop? That's the goal of the Qiskit project. This repository is the core component of Qiskit, containing the building blocks for creating and manipulating quantum circuits, operators, and primitives. (3.9k stars)
Create sophisticated dashboards with just a few lines of configuration, leveraging libraries like Plotly and Dash for rendering. Configuration can be written in multiple formats, including Pydantic models, JSON, YAML, or Python dictionaries. (1.5k stars)
This is a collection of machine learning models, algorithms, and utilities, written exclusively using NumPy and the Python standard library. (14k stars)
Extract detailed information about every text character, rectangle, and line in a PDF, with support for table extraction and visual debugging. (4.6k stars)
Podcasts & Videos
× 2A Mojo tutorial video from FreeCodeCamp with close to 100k views.
This video explores the exciting new features and improvements in Python 3.12, as well as some elements that will be removed in the upcoming release.