Python Monthly News

Python News: What's New From May 2023

by Geir Arne Hjelle community

May 2023 was an important month for Python, as the upcoming Python 3.12 version is now feature complete. You can dig into a lot of information about Python and its development by reading the coverage of the Language Summit and watching videos from PyCon US. Modular has announced a new programming language that’s based on Python.

Grab a cup of your favorite beverage and sit down with the most important Python news from the last month.

Python 3.12 in Beta

Since 2019, a new version of Python has been released every year in October. The next version of Python–Python 3.12—is no different. Its release is planned for October 2, 2023.

Python 3.12 reached an important milestone last month when its first beta version was released. A beta release is an early release of an upcoming Python version. In contrast to alpha releases, which have been available for a while, the betas are feature complete.

Being feature complete means that there’ll be no features added to Python 3.12 that aren’t already in the beta version. Instead, the time until the final release in October will focus on finding and fixing bugs and other issues. The core developers ask for your help:

We strongly encourage maintainers of third-party Python projects to test with 3.12 during the beta phase and report issues found to the Python bug tracker as soon as possible. (Source)

You should install the beta version and test that your code still works. Finding bugs during the beta phase is an important and impactful way to contribute to Python. If you maintain a package on PyPI, then you can help the community by running tests and publishing wheels for Python 3.12.

You can learn about all the upcoming features from What’s New in Python 3.12. Some highlights are the following:

In addition, the Faster CPython project continues to deliver performance improvements, and Python 3.12 will be even faster than Python 3.11.

Coverage of the Python Language Summit Available

The Python Language Summit is an annual event where developers of CPython and other Python implementations meet to share information and discuss issues.

As usual, the summit was hosted during PyCon US in Salt Lake City. While the the summit focuses on discussion and consensus-seeking, it was framed by nine presentations and three lightning talks. The meeting isn’t recorded, but Alex Waygood has covered the presentations and resulting discussions in a series of blog posts.

As usual, the topics discussed were quite diverse. They included Python’s C API, the global interpreter lock, native profiling, the standard library, pattern matching, Python on mobile, and ways to deal with burnout. The lightning talks covered the LLVM-BOLT optimizer, lazy imports, and callable modules.

The language summit is a great occasion to take the pulse of the most important discussions about Python. While attendance is restricted, catching up on the blog posts gives you insight into the future of your favorite programming language.

PyCon US Videos Posted

The annual PyCon US conference is one of the largest community gatherings. This year, Salt Lake City hosted the twentieth PyCon US conference, a week packed with tutorials, talks, and sprints.

All talks and tutorials were recorded, and they’re now available for you on PyCon’s YouTube channel. Conveniently, there’s even a PyCon 2023 playlist that includes everything.

This year, there were four headline keynotes:

Additionally, plenary presentations were given by conference chair Mariatta Wijaya, the Python Steering Council, PSF’s diversity and inclusion working group, PSF’s executive director Deb Nicholson, and Guido van Rossum.

More than 140 videos are available for your enjoyment. Among these, you can find over twenty tutorials about all things Python. You can learn more about command-line interfaces (CLIs), web-based graphical user interfaces (GUIs), decorators, comprehensions, and a whole host of other topics.

You can also enjoy close to a hundred presentations about Python and the whole ecosystem. These range from fun applications of Python to technical explorations of Python’s latest features. One nice aspect of PyCon US is that it includes a Spanish-language track of talks. This year, the schedule included fifteen such charlas. All of these are also available in the PyCon US 2023 playlist.

PyPI Improves Security

The Python Software Foundation (PSF) works hard to improve end-user security on PyPI. In April, they introduced trusted publishers and PyPI organizations. Over the last month, they’ve announced several new initiatives.

With support from AWS, they’re creating a new PyPI safety and security engineer position. This person will work together with the previously announced security developer in residence.

Last year, PyPI started requiring that developers of critical libraries use two-factor authentication. They’ve now announced that every account that maintains a PyPI project or organization needs to enable two-factor authentication by the end of 2023.

As part of the long-term project to improve user security, PyPI has also been reducing the number of places where they store IP addresses. Until now, IP addresses have been stored in logs and different event records. They’ve been removed from many of these database tables—in particular, from those places where the IP addresses had no practical function.

In March and April, the PSF received subpoenas from the US Department of Justice requesting user data about five PyPI users. The PSF fulfilled the request and provided data as described in their blog post.

In general, PyPI and the PSF don’t collect a lot of personal data. Still, they’re using this occasion to improve their data retention policies by making sure that they don’t store more data than necessary and that these aren’t stored longer than necessary. This can help lessen the impact if data gets compromised in any way.

Updates to PyPI’s security policies will be posted on their blog.

Mojo, A New Programming Language Based on Python, Announced

In early May, Modular announced that they’re working on a new programming language. The new language—Mojo—is currently available in a limited preview. You can sign up for a waitlist to try the new language yourself. The product keynote demonstrates Mojo and explains how it works together with Modular’s new unified AI inference engine.

One feature of Mojo that makes it attractive to Python programmers is that the syntax is very familiar. In fact, the long-term plan is that Mojo will be a superset of Python. In other words, all valid Python code will also be valid Mojo code.

But Mojo aims to be more than a new Python. According to its home page:

Mojo combines the usability of Python with the performance of C. (Source)

While it’s based on Python, the language adds several features inspired by other programming languages:

  • Static typing at compile time
  • High-performance structures that can replace many uses of Python classes
  • Memory ownership, inspired by Rust
  • Strong differentiation of immutable and mutable variables
  • Parametric algorithms and auto-tuning that can take advantage of hardware

Mojo is still early in development, and many of the planned features aren’t implemented yet. This includes important Python structures like classes, dictionaries, and lists. One characteristic of Mojo is that even if it’ll support Python syntax and Python’s dynamic features, the language often has a more static counterpart.

For example, a Python class is defined with the class keyword and allows things, like monkey-patching and dynamically bound instance variables, to change at runtime. Mojo prefers to use structures defined with the struct keyword. These are static and bound at compile time. That allows the compiler to inline them into their container for improved performance.

In the following Mojo code, you define a Point structure containing two integers and write a function to calculate the Manhattan distance between the two points:

from Math import abs

struct Point:
    var x: Int
    var y: Int

    fn __init__(inout self, x: Int, y: Int):
        self.x = x
        self.y = y

fn manhattan_distance(p1: Point, p2: Point) -> Int:
    return abs(p1.x - p2.x) + abs(p1.y - p2.y)

While this code looks a bit like Python, you also notice several differences. The names of Mojo modules and types are title-cased—for example, Math instead of math and Int instead of int. Mojo understands functions defined with the def keyword but prefers fn-functions as they have some limitations, like immutable argument values and obligatory type specifications, that improve performance.

Mojo uses a let or var declaration to specify whether a variable is immutable or mutable, respectively. A variable declared with let is effectively a constant at runtime, while var-variables can change their values.

You can learn more about Mojo and its syntax in the documentation. Jeremy Howard describes Mojo in an enthusiastic blog post and compares it to alternatives like Julia, JAX, Numba, and Cython.

What’s Next for Python?

While Mojo is getting a lot of buzz for its promising beginnings, May 2023 has also been an important one for the development of Python and the community. Python 3.12 has reached the beta stage and is ready for everyone to test. PyPI is ramping up security for its users, and there are lots of talks and presentations from PyCon US for you to watch.

What’s your favorite Python news story from May? Let us know in the comments. Happy Pythoning!

🐍 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 Geir Arne Hjelle

Geir Arne is an avid Pythonista and a member of the Real Python tutorial team.

» More about Geir Arne

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!

Keep Learning

Related Topics: community