Formerly Janakpur Engineering College (JEC)Affiliated to Tribhuvan University

Python 3.15 ships with lazy imports, frozendict and a faster JIT

Python 3.15.0 arrived on 9 October with UTF-8 as the default encoding, explicit lazy imports, a new frozendict type and a quicker experimental JIT.

BCTBEI

The Python core team released Python 3.15.0 on 9 October 2026, the Python Insider blog announced. The release contains 5,643 changes from 1,012 contributors. Python now uses UTF-8 text encoding by default on every system, programs can delay loading modules until they are needed, and the experimental JIT compiler is 7 to 8 percent faster on Linux.

  • 5,643commits that went into the release
  • 7-8%average JIT speed gain on x86-64 Linux
  • 11-12%average JIT speed gain on Arm-based Macs
  • 1,000,000samples per second possible with the Tachyon profiler
  • 2031the year Python 3.15 support is scheduled to end

What happened

Python is a programming language used widely for data analysis, AI, web services and scripting. A new major version comes out every October. Release manager Hugo van Kemenade announced Python 3.15.0 on the official Python Insider blog on 9 October 2026. He wrote that it was built from 5,643 commits, or saved changes, by 1,012 contributors. The full list of changes is in the official document called What's New in Python 3.15.

The biggest changes, according to that document, are lazy imports, two new built-in types called frozendict and sentinel, UTF-8 as the default text encoding, unpacking inside comprehensions, and a stable interface for free-threaded builds. The standard library gains a new profiling package that includes a fast sampling profiler named Tachyon. The release team thanked many volunteers and the Sovereign Tech Agency, which supported the release manager's work.

The blog also gave a warning for Mac users. On macOS 27.0, programs that use the tkinter graphics toolkit, including IDLE, the simple editor that comes with Python, may freeze when opening some dialog windows. The team says this comes from a change in macOS and affects all current Python versions. It suggests that people who depend on IDLE wait before upgrading macOS, or test their work first.

The engineering behind it

Text encoding decides how letters are stored as bytes. Until now, if a program opened a file without naming an encoding, Python used the system's local setting. On many Windows computers this was not UTF-8, so a file written on one machine could show broken characters on another. Python 3.15 uses UTF-8 by default everywhere. The documentation still advises programmers to name the encoding explicitly for the best compatibility across versions. Programs that need the old behaviour can turn it off with a setting.

Lazy imports solve a startup problem. When a program imports a module, Python must find the file, read it, compile it and run its top-level code. Large programs can spend seconds on imports they never use in a given run. With the new lazy keyword, Python creates a small placeholder and only loads the real module when the program first uses it. Lazy imports are allowed only at the top level of a file.

A frozendict is a dictionary that cannot be changed after it is created. Because it cannot change, it can be hashed, so it can be used as a key in another dictionary or stored in a set. A sentinel is a unique marker value, often used to mean that no value was given. Comprehensions can now use the star operator to flatten several lists into one, replacing a nested loop in a single line.

On speed, the What's New document reports that the experimental JIT compiler gives a 7 to 8 percent average gain over the standard interpreter on x86-64 Linux, and 11 to 12 percent on Apple computers with Arm chips. It also notes that results vary widely between programs, from about 15 percent slower to more than twice as fast. Official 64-bit Windows installers now use the faster tail-calling interpreter.

Threads and profiling

For years, standard Python has used a global interpreter lock, which lets only one thread run Python code at a time. Free-threaded builds remove that lock, so several threads can run in parallel on different processor cores. Python 3.15 adds a stable interface for C extensions on these builds. In general, a stable interface means a library can be compiled once and keep working across later versions, which makes it easier for library makers to support the new builds.

The new Tachyon profiler works by sampling. Instead of recording every function call, which slows a program down, it regularly takes a snapshot of what the program is doing. The documentation says it can attach to a program that is already running, without changing its code, and sample up to one million times per second. This helps find slow parts of a program in real use. The older kind of profiler, which records every call, now sits in the same package under the name profiling.tracing.

What it means in Nepal

The sources do not discuss Nepal. One change is still directly useful for anyone who works with Nepali text. Devanagari characters only display correctly if they are saved and read with the right encoding, and UTF-8 handles them. With UTF-8 now the default, a script that reads a Nepali text file on a Windows laptop is less likely to fail or show broken characters. Naming the encoding in your code is still the safest habit.

There is also a timing point for labs and projects. According to the Python developer guide, Python 3.10 reached its end of life on 1 October 2026, which means it no longer receives security fixes. Python 3.15 is scheduled to be supported until October 2031. Projects still running 3.10 or older should plan an upgrade, and test their code and libraries on a newer version before they switch.

What to study if this interests you

Foundation of Data Science, ENCT 202, in the third semester of BCT, is where many students first use Python for real data work, including reading text files. Operating System, ENCT 254, in the fourth semester, explains threads, locks and scheduling, which helps you understand why removing the global interpreter lock matters. Numerical Methods, ENSH 252, in the fourth semester of BCT and BEI, is a course where speed of computation and profiling become practical concerns.

Words in this story

UTF-8
A standard way to store text as bytes that can represent almost every writing system, including Devanagari.
JIT compiler
A just-in-time compiler turns frequently used code into machine instructions while the program runs, to make it faster.
Global interpreter lock
A lock in standard Python that lets only one thread run Python code at a time.
Profiler
A tool that measures where a program spends its time, so you can find the slow parts.

Where this comes from

Written in our own words; no sentence is copied from these reports. Researched with AI assistance on 11 October 2026; no member of faculty has reviewed it yet. If you spot a mistake, call 01-5091616 and we will correct it and say so.

Next story: 1 keVGeneral Fusion heats plasma past 1 keV by squeezing it with metal

Last reviewed by Imperial College of Engineering. Written 11 October 2026 from the sources above.