-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Improvements in regular expression doc #114357
base: main
Are you sure you want to change the base?
Conversation
The check about the f argument type was removed in this commit: python@2c94aa5 Thanks for Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) by the help with this bug.
…#106335) Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API.
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.
This PR does 3 things.
- Add headers. I have thought to propose the same. Please add 1 more at 320, something like
.. _re_extension_notation
Extension notation
^^^^^^^^^^^^^^^^^^
CHANGE
-
Add double backticks, either new or extending single backticks. The existing text always put backticks on REs and sometimes on text matched. PR makes that (nearly, 2 expections noted) always on matches. Defensible since this seems the majority of existing cases. CHANGE
-
Add 'only' in several places. I am not sure these are needed, but I see existing similar uses.
@serhiy-storchaka I want to finish this RE doc change. Any additional comments from you?
Doc/library/re.rst
Outdated
only 'foo'. More interestingly, searching for ``foo.$`` in ``'foo1\nfoo2\n'`` | ||
matches 'foo2' normally, but 'foo1' in :const:`MULTILINE` mode; searching for | ||
matches 'foo2' normally, but ``'foo1'`` in :const:`MULTILINE` mode; searching |
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.
To be consistent with other additions, 'foo' above and 'foo2' here should be backticked. But see review summary.
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.
Done.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I am not sure that there is a need in these changes.
|
Hi, @terryjreedy. Thank you for your review and comments. The items 1 and 2 are done. Concern 3: the idea is to make the Without >>> import re
>>> re.findall(r'\d+', '567abc123٠١٢٣٤٥٦٧٨٩')
['567', '123٠١٢٣٤٥٦٧٨٩'] However, with >>> import re
>>> re.findall(r'\d+', '567abc123٠١٢٣٤٥٦٧٨٩', re.ASCII)
['567', '123'] |
This can start adding more in-line examples, like in progress with strings (#119445). |
I have made the requested changes; please review again |
Thanks for making the requested changes! @terryjreedy: please review the changes made to this pull request. |
📚 Documentation preview 📚: https://cpython-previews--114357.org.readthedocs.build/