-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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-30397: Add re.Pattern and re.Match. #1646
bpo-30397: Add re.Pattern and re.Match. #1646
Conversation
Also add and update docstrings. Change __module__ of the error, Pattern and Match types.
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @rosslagerwall and @Yhg1s to be potential reviewers. |
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 for doing this. I guess it's too scary to make these classes generic (like their counterparts in typing.py) -- after all we don't do that for other ABCs either.
@@ -690,7 +690,7 @@ PyDoc_STRVAR(_sre_SRE_Match_span__doc__, | |||
"span($self, group=0, /)\n" | |||
"--\n" | |||
"\n" | |||
"For MatchObject m, return the 2-tuple (m.start(group), m.end(group))."); | |||
"For match object m, return the 2-tuple (m.start(group), m.end(group))."); |
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.
Shouldn't that be "Match object"?
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.
I don't know. The term "match object" is widely used in the documentation (unlikely to just added name Match
).
Yes. I was thinking about using these new classes in |
Hi there. Python 3.7 removes `re._pattern_type` and renames it to `re.Pattern`. python/cpython#1646 I also remove test for py3.3(point to python3.4, which is redudant) and add test for py3.6 & 3.7. :)
Also add and update docstrings.
Change
__module__
of theerror
,Pattern
andMatch
types.https://bugs.python.org/issue30397