Welcome to the May 2025 edition of the Python news roundup. Last month brought confirmation that Python will have the eagerly-awaited template strings, or t-strings, included in the next release. You’ll also read about other key developments in Python’s evolution from the past month, updates from the Django world, and exciting announcements from the community around upcoming conferences.
From new PEPs and alpha releases to major framework updates, here’s what’s been happening in the world of Python.
Join Now: Click here to join the Real Python Newsletter and you'll never miss another Python tutorial, course update, or post.
PEP 750: Template Strings Coming to Python
PEP 750 introduces template strings, a new standard mechanism for defining string templates as reusable, structured objects. Unlike f-strings or str.format()
, which embed formatting directly in string literals, template strings separate the definition of the string structure from the data used to populate it:
>>> template = t"Howdy, {input('Enter your name: ')}!"
Enter your name: Stephen
>>> template
Template(
strings=('Howdy, ', '!'),
interpolations=(
Interpolation('Stephen', "input('Enter your name: ')", None, ''),
)
)
>>> for item in template:
... print(item)
...
Howdy,
Interpolation('Stephen', "input('Enter your name: ')", None, '')
!
This new tool opens up new possibilities for dynamic formatting, localization, user-facing messages, and more. It also makes it easier to share and reuse format templates across an application. The addition of t-strings is already being described as a major enhancement to Python’s string-handling capabilities.
Other Python Language Developments
Python 3.14 continues to take shape, with a new alpha release and several PEPs being accepted or proposed. These updates give a sense of where the language is heading, especially in areas like debugging, dependency management, and type checking.
Python 3.14.0a7 Released
Python 3.14.0a7 was released in April, marking the final alpha in the Python 3.14 development cycle. This release includes several fixes and tweaks, with the focus now shifting to stabilization as the first beta approaches.
Alongside the 3.14 alpha, the Python core team also issued a set of maintenance releases: 3.13.3, 3.12.10, 3.11.12, 3.10.17, and 3.9.22. These include bug fixes and security patches across all actively supported Python versions.
With the alpha phase complete, Python 3.14 will now enter beta. That means no new features will be added, and the focus will shift to fixing bugs and finalizing documentation ahead of the official release later this year.
PEP 751: A File Format to Record Python Dependencies
PEP 751 has been accepted. This PEP defines a new file format based on TOML for recording dependencies, aimed at enabling reproducible installs across environments.
The format captures the state of a project’s environment at a point in time, allowing developers to install exactly the same versions of every dependency, regardless of operating system or Python version. While still an early step, this format could eventually support a more consistent and reliable project setup experience for Python users.
PEP 768: A Safe Debugging Interface for CPython
PEP 768 has also been accepted and introduces a new, low-overhead interface for external debuggers to connect to running Python processes. Inspired by tools like gdb -p
, this interface allows debuggers to safely attach to a live CPython process by its process ID and run debugging scripts at predefined points during interpreter execution.
The design avoids unsafe code injection by extending Python’s thread state and evaluation loop, ensuring compatibility with multithreaded programs and Python’s audit hooks. While this PEP is primarily aimed at tool developers, Python users can expect better stability and support in advanced debugging tools as a result.
The change is part of an ongoing effort to improve Python’s introspection and tooling capabilities without compromising runtime safety.
PEP 781: A Built-in Constant for TYPE_CHECKING
PEP 781 is a new draft proposing that TYPE_CHECKING
, currently part of the typing
module, become a built-in constant. It’s often used to wrap import statements that are only needed during static analysis.
By making TYPE_CHECKING
always available, this change would remove a common friction point for library authors and simplify conditional imports in type-hinted code.
Django and Web Development
April was a busy month for Django developers. A new release and important security updates brought improvements and fixes across multiple supported versions.
Django 5.2 Released
The Django team released version 5.2, adding several developer-facing improvements:
- Support for composite primary keys, a long-requested feature
- Automatic model imports in the interactive shell
- Enhanced options for customizing how forms render in templates
If you’ve ever manually set up custom form widgets or imported your models every time you ran manage.py shell
, then this release might make your life a little easier.
Security Updates for Django 5.0, 4.2, and 3.2
The team also issued security patches for supported Django versions to address potential vulnerabilities in file uploads and some edge cases in SQL query generation.
Django users are encouraged to update as soon as possible to ensure they’re protected.
Python Community Events
Two of the biggest Python conferences are on the horizon, with PyCon US just weeks away and EuroPython set for early summer.
PyCon US 2025 Kicks Off This Month
PyCon US 2025 will take place in Pittsburgh from May 14 to 22. Attendees can look forward to a packed schedule of talks, tutorials, and sprints, along with keynotes from leaders in the Python ecosystem.
The event also includes a hallway track, lightning talks, and plenty of chances to connect with fellow developers. To prepare yourself and maximize your experience, check out our helpful guide on How to Get the Most Out of PyCon US.
If you can’t make it in person, livestreams and recordings will be available.
EuroPython 2025 Heads to Prague
EuroPython 2025 is scheduled for July 14 to 20 in Prague, Czech Republic. Ticket sales are now open.
As one of the largest Python events in Europe, EuroPython brings together developers, educators, and researchers from across the continent and beyond.
What’s Next for Python?
Python 3.14 is now transitioning from its alpha phase to beta, which means the language feature set is frozen and the focus shifts to testing and documentation. Several accepted PEPs—like template strings and a reproducible dependency format—are already shaping what Python 3.14 will deliver.
Elsewhere, Python’s type system continues to evolve, and new capabilities like safe debugger interfaces are paving the way for better tooling and developer experiences.
We’ll be back next month with more highlights from the Python world. Happy Pythoning!