A well known anti-pattern in Python is use of re.match when you meant to use re.search.
re.fullmatch was added in 3.4 via https://bugs.python.org/issue16203 for similar reasons.
re.prefixmatch would be similar: we want the re.match behavior, but want the code to be obvious about its intent. This documents the implicit ^ in the name.
The goal would be to allow linters to ultimately flag re.match as the anti-pattern when in 3.10+ mode. Asking people to use re.prefixmatch or re.search instead.
This would help avoid bugs where people mean re.search but write re.match.
The implementation is trivial.
This is **not** a decision to deprecate the widely used in 25 years worth of code's re.match name. That'd be painful and is unlikely to be worth doing without spreading it over a 8+ year timeline. |