Python 3.8 Release History

Python 3.8 (released October 14, 2019) introduced syntax improvements that made Python code more concise and expressive, along with runtime and standard library enhancements.

Assignment Expressions (The Walrus Operator :=)

The most notable feature — PEP 572, also known as the walrus operator.

It allows assigning and using a value in one expression:

import re

if match := re.search(r'fox', "The quick brown fox"):
    print(match.group(0))
while (line := file.readline()) != "":
    print(line)

Positional-Only Parameters (/)

PEP 570 introduced:

def power(x, y, /, mod=None):
    return x ** y

f-string Debugging

New syntax for quick debugging:

value = 42
print(f"{value=}")

Standard Library Improvements

Performance Improvements

Deprecations

Subversions log


Official 3.8 documentation