Repository navigation
Add a link to the regex module in re documentation #66784
Copy link
Copy link
Closed
Labels
3.7 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc direasytopic-regextype-featureA feature request or enhancementA feature request or enhancement
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/brettcannon'
closed_at = <Date 2017-02-27.14:54:48.344>
created_at = <Date 2014-10-10.07:48:05.438>
labels = ['expert-regex', 'easy', 'type-feature', '3.7', 'docs']
title = 'Add a link to the regex module in re documentation'
updated_at = <Date 2017-03-24.23:42:01.502>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2017-03-24.23:42:01.502>
actor = 'Mariatta'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2017-02-27.14:54:48.344>
closer = 'berker.peksag'
components = ['Documentation', 'Regular Expressions']
creation = <Date 2014-10-10.07:48:05.438>
creator = 'serhiy.storchaka'
dependencies = []
files = ['36900', '37052', '46561', '46575']
hgrepos = []
issue_num = 22594
keywords = ['patch', 'easy']
message_count = 17.0
messages = ['228961', '229091', '229250', '229253', '230142', '287209', '287229', '287240', '287246', '287250', '287299', '287362', '287379', '290382', '290383', '290384', '290390']
nosy_count = 12.0
nosy_names = ['brett.cannon', 'georg.brandl', 'pitrou', 'ezio.melotti', 'mrabarnett', 'docs@python', 'tshepang', 'serhiy.storchaka', 'marco.buttu', 'malin', 'anupama.srinivas.murthy', 'Mariatta']
pr_nums = ['241', '316', '317', '321']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue22594'
versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7']Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc direasytopic-regextype-featureA feature request or enhancementA feature request or enhancement
Activity
serhiy-storchaka commentedon Oct 10, 2014
The regex module is purposed as a replacement of standard re module. Of course we fix re bugs, but for now regex is more bugfree. Even after fixing all open re bugs, regex will remain more featured. It would be good to add a link to regex in re documentation (as there are links to other GUI libraries in Tkinter documentation).
ezio-melotti commentedon Oct 11, 2014
+1
anupamasrinivasmurthy commentedon Oct 13, 2014
I have added the link and attached the patch below. Could you review it?
Thank you
birkenfeld commentedon Oct 13, 2014
"currently more bugfree and intended to replace re"
The first part is spreading FUD if not explained in more detail. The second is probably never going to happend :(
anupamasrinivasmurthy commentedon Oct 28, 2014
I have modified the patch and listed the points I know. Could you review it?
marco-buttu commentedon Feb 7, 2017
IMHO the reference proposed in the patch is too verbose. Adding details like what is supported and how to use some features I think is out of the scope of the reference. Moreover, if the regex module changes the features we are reporting in the reference, we'll have an outdated reference.
In addition, as Brett Cannon pointed out in msg287159, the preferred way to mention a 3rd-party library should be by adding the reference at the top of the page, as in Doc/library/urllib.request.rst:19.
I propose to just add a more concise reference, at the beginning of the page, like the following:
.. seealso::
regex <https://pypi.python.org/pypi/regex/>_,a third-party alternative regular expression module.
mrabarnett commentedon Feb 7, 2017
I agree with Marco that it shouldn't be too verbose. I'd like to suggest that it says that it's compatible (i.e. has the same API), but with additional features.
marco-buttu commentedon Feb 7, 2017
Looking at the regex module and documentation, it is not clear to me whether its API behaves exactly as the re API. In addition, being a third-party module, things can change in the future.
To be defensive, IMO it is better to write as in the Ezio comment (in the review): "mostly compatible API". I propose a shorter patch, that adds the reference at the beginning of the page (right after the module introcution).
mrabarnett commentedon Feb 7, 2017
With the VERSION0 flag (the default behaviour), it should behave the same as the re module, and that's not going to change.
brettcannon commentedon Feb 7, 2017
How about "a mostly compatible API with more thorough Unicode support"? That focuses on the VERSION1 API which is a differentiator for regex.
marco-buttu commentedon Feb 8, 2017
Thanks for the clarification Matthew. However, the default version will change, as the regex PyPI page points out: "In the short term this will be VERSION0, but in the longer term it will be VERSION1." I propose a patch that integrates the Brett suggestion.
mrabarnett commentedon Feb 8, 2017
Ah, well, if it hasn't changed after this many years, it never will. Expect one or two changes to the text. :-)
animalize commentedon Feb 9, 2017
How about this? Is it too long?
@matthew Barnett, I'm animalize on your repository.
.. seealso::
Mariatta commentedon Mar 24, 2017
New changeset c8e2021 by Mariatta in branch '2.7':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-321)
c8e2021
Mariatta commentedon Mar 24, 2017
New changeset 21c697f by Mariatta in branch '3.5':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-317)
21c697f
Mariatta commentedon Mar 24, 2017
New changeset 1457984 by Mariatta in branch '3.6':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-316)
1457984
Mariatta commentedon Mar 24, 2017
New changeset ed6795e by Mariatta (Marco Buttu) in branch 'master':
bpo-22594: Add a link to the regex module in re documentation (GH-241)
ed6795e