Python News

Python News Roundup: December 2024

by Martin Breuss Dec 09, 2024 1 Comment community

The Python community has kept up its momentum this month, delivering a host of exciting updates. From the promising improvements to template strings in PEP 750 to the release of Python 3.14.0a2, innovation is front and center. Developers are exploring new tools like partial validation in Pydantic 2.10, while popular projects adapt to the end of life of Python 3.8.

December also welcomes the return of the beloved Advent of Code, challenging programmers and problem solvers with daily puzzles. And for those planning ahead, the PyCon 2025 call for proposals is closing soon, marking a final opportunity to contribute to the community’s largest annual gathering.

Whether you’re diving into cutting-edge features, revisiting Python fundamentals, or connecting with fellow developers, there’s something for everyone this month. Let’s round up the most important developments of last month and see how they can inspire your next Python project!

PEP 750 – Template Strings Updated

The authors of PEP 750, which you might have first encountered introducing tag strings, have revised and significantly updated their proposal.

The central point of the PEP is now renamed as template strings, or t-strings, and aligns its syntax with the beloved f-strings:

Python
planet = "World"
greeting = t"Hello, {planet}!"

Looks very familiar! The main practical difference to f-strings is that t-strings are lazily evaluated, which opens the door to common string interpolation scenarios that f-strings can’t handle, such as:

  • Performance-optimized logging
  • Internationalization
  • Template reuse
  • HTML templating

All of the above are examples of string interpolation that requires lazy evaluation.

If the PEP gets accepted and implemented, then you’ll be able to use t-strings where you currently have to resort to str.format(), using a Template object from the string module, or even the older modulo (%) string formatting approach.

As the Python community continues to innovate, PEP 750 is a testament to the ongoing efforts to enhance language features while keeping them intuitive for developers. If you want to dive deeper into this proposal and its potential impact, then you can read more in the detailed examples section of the PEP.

Python 3.14.0a2 Released

The Python 3.14 team rolled out the second alpha release of Python 3.14, version 3.14.0a2. This release is part of the ongoing development process for Python 3.14, with a total of seven alpha releases planned.

In addition to the features introduced in Alpha 1, like deferred evaluation of annotations and improved error messages, this release brings in some additional updates. One of them is implementing PEP 741, which introduces a unified C API to configure the Python initialization.

Another significant change is outlined in PEP 761. Starting with Python 3.14, the Python community will stop providing PGP signatures for release artifacts. Instead, the aim is to use sigstore for verification purposes. However, this shift is stirring some discussions, as summarized in the article Python PGP proposal poses packaging puzzles, which delves into some potential implications of the change.

Keep an eye on the development of Python 3.14 as the alpha releases progress towards the final version. Maybe you’d like to give this pre-release a spin and provide early feedback to the core Python developers.

The Python Ecosystem Adapts to Python 3.8 End of Life

Python 3.8 met its official end of life on October 7, 2024. As support for Python 3.8 has come to a close, developers and organizations are prompted to transition their projects to newer versions of the language. This shift ensures continued access to the latest features, security updates, and performance improvements that Python has to offer.

Among the projects adapting to these changes is Flask, a popular web framework that recently announced its 3.1.0 release. Flask’s new version drops support for Python 3.8, and requires developers to upgrade to Python 3.9 or newer to take advantage of the framework’s latest features. The release also introduces a series of enhancements aimed at improving security and key management.

Another popular project created additional distance from Python 3.8. Ruff released version 0.8, which drops Python 3.8 as the default assumed version unless you specify otherwise. The new default target Python version is now 3.9.

As Lukasz Langa, the release manager, mentioned in his post about the end of life for version 3.8:

Thanks, 3.8. You were a good one. […] But it’s time to move on to newer, greater things. (Source)

As the Python ecosystem continues to evolve, it’s best to stay up to date with the latest versions and features so that you can continue to build secure and efficient applications.

Pydantic Update Allows for Partial Validation

Pydantic has released version 2.10, which introduces several new features. One interesting addition is the support for partial validation with experimental_allow_partial. This allows you to validate Python objects that represent incomplete input data, or incomplete JSON strings.

This feature is particularly noteworthy for the Python community due to its relevance to emerging use cases. It allows you to process outputs from large language models (LLMs) or handle structured responses that the model streams instead of returning them completely formed. As the blog post for the version announcement mentions:

[…] you may wish to begin validating the stream while you’re still receiving data (e.g. to show partial data to users). (Source)

As AI and machine learning applications continue to gain traction, tools like Pydantic are evolving to meet the needs of developers working in these fields. The experimental_allow_partial flag is still in an experimental stage, and your feedback is welcome to help shape it into a final form.

The release notes provide an example that demonstrates how to implement partial validation using TypeAdapter, and support for BaseModel and Pydantic’s dataclass will probably follow soon.

The Python ecosystem thrives on the dynamic evolution of third-party libraries that cater to various programming needs. November was an active month for some of these popular libraries, with significant updates that promise to enhance the productivity and efficiency of Python developers worldwide.

The IPython interactive shell released version 8.30.0. The IPython REPL has become a staple for many Python enthusiasts in data analysis, scientific computing, and beyond.

On the data processing front, Polars makes a noteworthy leap from version 1.12.0 through version 1.16.0. This rapid progression through several releases highlights the library’s commitment to providing a fast and flexible DataFrame library for Python.

Polars is known for its lightning-fast execution and memory efficiency, making it a favorite among data scientists and analysts. The latest version brings further enhancements and optimizations, ensuring that users can handle large datasets with ease and precision.

Another exciting project that jumped a couple of minor versions in November is Textual, which went from 0.85.1 to 0.88.1. The framework for building text user interfaces (TUIs) introduced a couple of improvements, and even a small demo game that you can play at textual.demo.game:

A Textual interface showing a shuffle game with Python code snippets on it

You can shuffle the tiles using your arrow keys or by clicking with your mouse to arrange them correctly into valid Python code. The game is a nice visual demo implementation of what you can achieve using Textual.

PyCon 2025 Call for Proposals Closes

As we approach the end of the year, the PyCon 2025 call for proposals is officially closing on December 19, 2024. This is your last chance to submit your ideas and join the Python community in sharing your knowledge and experiences at the largest annual gathering of Python developers in the United States. Next year’s conference will take place in Pittsburgh, Pennsylvania, from May 14 to 22.

If you’ve been considering submitting a proposal, whether for a talk, a tutorial, or a poster, now is the time to take action. The conference organizers welcome a diverse range of topics, catering to both beginners and seasoned Python enthusiasts. You can present your ideas in either English or Spanish.

If you’re new to public speaking or need guidance on your proposal, then PyCon’s mentorship program is an invaluable resource. By participating in this program, you’ll receive support from an experienced mentor who can help you refine your proposal and ensure that you submit all the necessary information.

Don’t miss this opportunity to be part of next year’s largest gathering of Python enthusiasts and professionals. Whether you share insights on the latest developments, innovative projects, or best practices, your contribution can inspire and educate fellow Python developers from around the world.

Advent of Code Engages Puzzle Solvers

The holiday season is upon us, and with it returns the much-anticipated Advent of Code! This annual event, created by Eric Wastl, kicked off on December 1st, bringing joy and excitement to programmers and puzzle enthusiasts around the world. Each day until December 25th, participants are treated to unique and challenging programming puzzles that tests their problem-solving skills and creativity.

Whether you’re a seasoned programmer or a newcomer to coding, Advent of Code offers something for everyone. The puzzles are designed to be approachable for beginners while still offering depth and complexity for more advanced participants. This makes Advent of Code a fantastic way to learn new programming techniques and sharpen your skills.

The event fosters a strong sense of community, with participants sharing their solutions, discussing strategies, and learning from one another. Many programmers take to social media and online forums to exchange ideas and celebrate their successes, contributing to the festive and collaborative atmosphere that Advent of Code is known for.

If you’re looking for a fun and engaging way to challenge yourself this holiday season, then Advent of Code is the perfect opportunity. Join thousands of other puzzle solvers and see how many puzzles you can complete before Christmas Day.

What’s Next for Python?

As 2024 comes to a close, the Python community continues to thrive! There are exciting developments like the improvements to PEP 750’s template strings, the release of Python 3.14.0a2, and the dynamic evolution of third-party libraries such as Pydantic, Flask, Ruff, Polars, and Textual. Events like PyCon 2025 and Advent of Code provide opportunities to learn, engage, and contribute to the community.

Looking ahead, there’s much to explore and look forward to. Whether it’s testing the alpha releases of Python 3.14, diving into PEP 750’s potential for performance and internationalization, or experimenting with the latest features in popular libraries.

So, mark your calendars for PyCon 2025, try out Python’s latest releases, and don’t forget to tackle a few Advent of Code puzzles this holiday season. Your contributions and curiosity help shape the vibrant future of Python, ensuring it remains a powerful and versatile language for all.

Frequently Asked Questions

Now that you’re up to date with the latest Python news, you can use the questions and answers below to recap what you learned. Click the Show/Hide toggle beside each question to reveal the answer.

Template strings, or t-strings, are a proposed feature in PEP 750 that allow for lazily evaluated string interpolation, similar in syntax to f-strings.

Python 3.14.0a2 introduces features like a unified C API for Python initialization and the transition from PGP signatures to sigstore for release artifact verification.

Pydantic 2.10 introduces experimental_allow_partial, which lets you validate incomplete JSON strings or Python objects. This is useful in scenarios like handling streamed data from large language models (LLMs).

Transitioning from Python 3.8 is crucial as it has reached its end of life. It’s best to move to newer Python versions to access the latest features, security updates, and performance improvements.

Advent of Code is an annual event starting December 1st that offers daily programming puzzles, engaging programmers worldwide to test and enhance their problem-solving skills during the holiday season.

🐍 Python Tricks 💌

Get a short & sweet Python Trick delivered to your inbox every couple of days. No spam ever. Unsubscribe any time. Curated by the Real Python team.

Python Tricks Dictionary Merge

About Martin Breuss

Martin likes automation, goofy jokes, and snakes, all of which fit into the Python community. He enjoys learning and exploring and is up for talking about it, too. He writes and records content for Real Python and CodingNomads.

» More about Martin

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Master Real-World Python Skills With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

Master Real-World Python Skills
With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

What Do You Think?

Rate this article:

What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment below and let us know.

Commenting Tips: The most useful comments are those written with the goal of learning from or helping out other students. Get tips for asking good questions and get answers to common questions in our support portal.


Looking for a real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!