Skip to content
AI Learning Ground Start learning

News ·

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

Python 3.15 ships with PEP 810 lazy imports, a new sampling profiler, and comprehension unpacking, while Python 3.10 loses official support, letting maintainers adopt 3.11 features.

Hello Python 3.15, goodbye 3.10, and now I can use 3.11
Image: Simon Willison

Python 3.15 has been released, accompanied by a What's New guide curated by release manager Hugo van Kemenade. Because Python 3.10 (from 2021) is no longer supported, open source maintainers who support every supported version can now drop 3.10 and adopt features introduced in Python 3.11.

The headline 3.15 feature is explicit lazy imports from PEP 810: writing a lazy import defers loading the module until its symbols are first used. Simon Willison notes this directly addresses startup costs in his LLM CLI tool, where plugins using heavy dependencies like sentence_transformers previously added seconds to every invocation unless authors did manual lazy importing. Other additions include PEP 798 unpacking in comprehensions (an extension of PEP 448 syntax), the renaming of cProfile to profiling.tracing, and a new standard-library sampling profiler called Tachyon (profiling.sampling) that periodically captures stack traces with low overhead and can output flame graphs, heat maps, and Firefox profiler format. Benchmarking by Miguel Grinberg found 3.15 performance mostly similar to 3.14, but the experimental JIT delivered a 1.2x boost on a Fibonacci test—the first meaningful JIT gain he had observed.

For anyone building with AI or Python tooling, lazy imports make plugin-heavy CLI tools faster without author workarounds, and a built-in sampling profiler removes the need for external tools like py-spy. Dropping 3.10 unlocks 3.11 features such as TaskGroup and timeout() for asyncio, datetime.UTC, tomllib, and SQLite improvements including blobopen() and create_window_function(); Willison has already begun removing related workarounds and updated his cookiecutter templates to test against Python 3.11 through 3.15.

References

Read the full story at Simon Willison ↗Like, save or discuss on Buzz

#tooling #prompting