2 min

Tags in this article

, , ,

Python 3.8 has been released this October, bringing with it new capabilities designed to help developers produce their code effectively and efficiently.

Known for being open source, Python continues to be a popular, general-purpose programming language used for server-side web development, software development and more.

Walrus Operator and other key updates

One of the most notable additions included in the latest update to Python is affectionately dubbed the ‘Walrus Operator’, given its name because of the syntax that resembles the animal.

According to the documentation on the release, the new syntax assigns values to variables as part of a larger expression and can be used to reduce the size of programming loops, for instance by matching regular expressions where match objects are needed twice.

Provisional-only parameters (/) now have support in Python, indicating some function parameters are specified positionally and aren’t used as keyword arguments.

As such, pure Python functions can emulate the behaviour of existing C-coded functions. This means keyword arguments can be excluded when the parameter name isn’t needed and the parameter name can be changed without impacting the code.

Debugging and self-documenting expressions

The latest release also includes features designed for debugging and self-documenting expressions. For one, 3.8 includes support for new syntax in Python’s f-string.

The documentation notes state, “An f-string such as f'{expr=}’ will expand to the text of the expression, an equal sign, then the representation of the evaluated expression. The usual f-string format specifiers allow more control over how the result of the expression is displayed. The = specifier will display the whole expression so that calculations can be shown.”

Furthermore, Python now uses the same API whether it’s built in release or debug mode. On Unix, when Python is built in debug mode, it is now possible to load C extensions built in release mode and C extensions built using the stable API.

Python has also added new features to boost security, optimise performance and has worked to improve Python’s C engine based backend, enabling greater data processing abilities within the C API.

Python 3.8 is available on the Python downloads page.