dataqbs

Hello Python 3.15, goodbye 3.10, and now I can use 3.11

· Source: Simon Willison

Python 3.15 is now available, bringing a range of improvements that appeal to developers who keep code compatible across multiple language versions. Among the most notable changes is the introduction of “explicit lazy imports” (PEP 810), which let you declare modules or symbols with the keyword lazy and defer their loading until first use. This feature cuts startup time for applications that rely on heavy packages, such as the LLM command‑line tool, where delayed dependency loading eliminates several seconds of latency.

Another significant addition is the “unpacking in comprehensions” syntax (PEP 798), which simplifies creating lists, sets, or dictionaries from nested structures using the * or ** operators. For example, [*sublist for sublist in lists] produces a flattened list without nested loops.

In terms of performance, the standard library now includes a new sampling profiler called profiling.sampling (Tachyon). It captures stack traces at regular intervals with low overhead and produces reports, flame graphs, and heat maps without external tools.

Early benchmarks show that 3.15 does not dramatically outpace 3.14, except for a JIT experiment that achieved a 1.2× speedup on a Fibonacci calculation.

This update is valuable because it makes writing more efficient, modular code easier while preserving backward compatibility, benefiting open‑source projects and teams that aim to reduce startup times and improve performance observability.

Read the original article on Simon Willison

This summary is an informational synthesis produced by dataqbs.com. All rights to the original content belong to its author and the cited media outlet. We act solely as curators of technology news and claim no authorship.

Read this in Español · Deutsch