-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-102211: Document re.{Pattern,Match}
’s existence
#102212
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
Conversation
`typing` documents `re.Pattern`’s and `re.Match`’s existence so `re` should too
re.{Pattern,Match}
’s existencere.{Pattern,Match}
’s existence
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Preview: https://deploy-preview-102212--python-cpython-preview.netlify.app/library/re.html#match-objects Should "the following methods and attributes" be changed to "the following classes, methods and attributes"?
Would be nice to add something rather than leaving blank. Why do these classes exist? What use do they have for end users? "Useful for type hints"? |
I mean, they’re classes. They can be used for instance checks like all other classes. Weirdly they can’t be instantiated (why not, shouldn’t We could also move things up:
|
what would you prefer? |
If we're going to add the headers, let's add at least some sort of description, however short. |
this should be ready now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, two comments:
A
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have made the same suggestion on GenericAlias for both Pattern and Match: (also switched to versionchanged)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
happy with those changes! |
Is this waiting for anything? |
I think we're good here, thank you for your patience and the contribution! |
Thanks @flying-sheep for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
GH-108490 is a backport of this pull request to the 3.12 branch. |
GH-108491 is a backport of this pull request to the 3.11 branch. |
… (#108491) Co-authored-by: Philipp A <flying-sheep@web.de> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
… (#108490) gh-102211: Document `re.{Pattern,Match}`’s existence (GH-102212) (cherry picked from commit 6895ddf) Co-authored-by: Philipp A <flying-sheep@web.de> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
typing
documentsre.Pattern
’s andre.Match
’s existence sore
should too.I’m not sure what to add to the body of the classes, so for now I just added them as markers that indeed,
re
exports two classes by that name.Rendered:
re.Match
re.Pattern