[issue22594] Add a link to the regex module in re documentation
New submission from Serhiy Storchaka: 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). ---------- assignee: docs@python components: Documentation, Regular Expressions keywords: easy messages: 228961 nosy: docs@python, ezio.melotti, mrabarnett, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: Add a link to the regex module in re documentation type: enhancement versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Ezio Melotti added the comment: +1 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- stage: -> needs patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Tshepang Lekhonkhobe <tshepang@gmail.com>: ---------- nosy: +tshepang _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
anupama srinivas murthy added the comment: I have added the link and attached the patch below. Could you review it? Thank you ---------- components: -Regular Expressions keywords: +patch nosy: +anupama.srinivas.murthy Added file: http://bugs.python.org/file36900/regex-link.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Georg Brandl added the comment: "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 :( ---------- nosy: +georg.brandl _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Serhiy Storchaka <storchaka@gmail.com>: ---------- components: +Regular Expressions _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
anupama srinivas murthy added the comment: I have modified the patch and listed the points I know. Could you review it? ---------- versions: -Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37052/regex-link.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Brett Cannon <brett@python.org>: ---------- assignee: docs@python -> brett.cannon nosy: +brett.cannon _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Marco Buttu added the comment: 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. ---------- nosy: +marco.buttu _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Matthew Barnett added the comment: 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Marco Buttu added the comment: 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). ---------- Added file: http://bugs.python.org/file46561/regex_reference.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Matthew Barnett added the comment: With the VERSION0 flag (the default behaviour), it should behave the same as the re module, and that's not going to change. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Brett Cannon added the comment: How about "a mostly compatible API with more thorough Unicode support"? That focuses on the VERSION1 API which is a differentiator for regex. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Marco Buttu added the comment:
With the VERSION0 flag (the default behaviour), it should behave the same as the re module, and that's not going to change.
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. ---------- Added file: http://bugs.python.org/file46575/regex_reference.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Matthew Barnett added the comment: Ah, well, if it hasn't changed after this many years, it never will. Expect one or two changes to the text. :-) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Ma Lin added the comment: How about this? Is it too long? @Matthew Barnett, I'm animalize on your repository. .. seealso:: Third-party module `regex <https://pypi.python.org/pypi/regex>`_, is a substitute for re module, it offers some mainstream features which re module lacks (Atomic grouping, Possessive quantifiers, Variable-length lookbehind, Recursive matching). It also has further Unicode support, some advanced grammars appears in other regular expression engines, and many facilitations. ---------- nosy: +Ma Lin _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Marco Buttu <marco.buttu@gmail.com>: ---------- pull_requests: +204 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- versions: +Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- pull_requests: +277 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- pull_requests: +278 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- pull_requests: +282 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Mariatta Wijaya added the comment: New changeset c8e20218d77c5b8c16fd76d45612ae48ca3fba91 by Mariatta in branch '2.7': bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-321) https://github.com/python/cpython/commit/c8e20218d77c5b8c16fd76d45612ae48ca3... ---------- nosy: +Mariatta _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Mariatta Wijaya added the comment: New changeset 21c697fd1073d6ab59e2ba82ea80bc81b9c4125c by Mariatta in branch '3.5': bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-317) https://github.com/python/cpython/commit/21c697fd1073d6ab59e2ba82ea80bc81b9c... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Mariatta Wijaya added the comment: New changeset 1457984c003b1e461f8aab93bfc37fd8e42312d5 by Mariatta in branch '3.6': bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-316) https://github.com/python/cpython/commit/1457984c003b1e461f8aab93bfc37fd8e42... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
Mariatta Wijaya added the comment: New changeset ed6795e46f7653e23b862efad240a93453e7df97 by Mariatta (Marco Buttu) in branch 'master': bpo-22594: Add a link to the regex module in re documentation (GH-241) https://github.com/python/cpython/commit/ed6795e46f7653e23b862efad240a93453e... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22594> _______________________________________
participants (11)
-
anupama srinivas murthy
-
Berker Peksag
-
Brett Cannon
-
Ezio Melotti
-
Georg Brandl
-
Ma Lin
-
Marco Buttu
-
Mariatta Wijaya
-
Matthew Barnett
-
Serhiy Storchaka
-
Tshepang Lekhonkhobe