Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42353: Add prefixmatch APIs to the re module #31137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Feb 5, 2022

Adds prefixmatch APIs to the re module.

These alleviate common confusion around what "match" means as Python is
different than other popular languages in our use of the term as an API
name. The original "match" names are NOT being deprecated. Source
tooling like linters are expected to suggest using prefixmatch instead
of match to improve code health and reduce cognitive burden of
understanding the intent when reading code.

See the documentation changes within this PR for a better description.

[STATUS: I'm not happy with the current implementation in the PR branch - I want to make this more conservative and not define multiple functions but instead have both names just be a reference to the same function/method]

https://bugs.python.org/issue42353

These alleviate common confusion around what "match" means as Python is
different than other popular languages in our use of the term as an API
name.  The original "match" names are NOT being deprecated.  Source
tooling like linters are expected to suggest using prefixmatch instead
of match to improve code health and reduce cognitive burden of
understanding the intent when reading code.

See the documentation changes within this PR for a better description.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants