Claude Discovery

← All discoveries

A woman engineer focuses on software analysis using a laptop indoors.
Photo by ThisIsEngineering on Pexels
best-practice

re.match() Isn't Gone, Just Officially Discouraged in Python 3.15

2026-09-11 ยท source:

Python 3.15 soft-deprecates re.match(), marking it as discouraged for new code without any plan to remove it, in favor of a clearer alternative.

What it is

A documentation-level change in the upcoming Python 3.15 release, described by release manager Hugo van Kemenade, that applies PEP 387 soft deprecation to the widely used but confusing `re.match()` function.

What it does

It marks `re.match()` as something that should no longer be used to write new code, without threatening removal, and points developers toward a clearer alternative already available in the standard library.

Why it matters

Unlike a hard deprecation, this changes nothing at runtime today, but it signals where Python's regex API is heading and gives a low-risk reason to clean up new code, even if old code stays untouched for years.

Go to source →
pythondeprecation