The best new features in Python 3.15
The first full beta of Python 3.15 has arrived, and it’s one of the most feature-packed Python releases in many a moon. Here’s a rundown of the biggest, boldest, and most important innovations, changes, and fixes. Lazy imports A long-asked for feature, lazy imports allow imports to be processed only when they’re actually used by the program. Thus for slow-importing modules that impose a large cost on a program’s startup time, you can now easily defer that cost to when the code of that module will actually be executed. You can use lazy imports explicitly using the new lazy import syntax, but you can also force code with conventional imports to behave lazily, either programmatically or by using an environment variable. This makes it easy to make existing code take advantage of this feature without tons of rewriting. Best of all, there’s no drawback to making imports lazy: they otherwise behave exactly as intended. The frozendict built-in type Only rarely does Python add a new data type,