The f-string f"{x=}" expands to f"x={x}"
It supports both single variables and more complex expressions. Here’s a few examples:
>>> x = 42 >>> f"{x=}" 'x=42' >>> f"{1+2=}" '1+2=3' >>> f"{(1+2)*3=}" '(1+2)*3=9'This is described in What’s New In Python 3.8;
(via)