Skip to content
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

Add a link to the regex module in re documentation #66784

Closed
serhiy-storchaka opened this issue Oct 10, 2014 · 17 comments
Closed

Add a link to the regex module in re documentation #66784

serhiy-storchaka opened this issue Oct 10, 2014 · 17 comments
Assignees
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir easy topic-regex type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 22594
Nosy @brettcannon, @birkenfeld, @pitrou, @ezio-melotti, @serhiy-storchaka, @marco-buttu, @animalize, @Mariatta
PRs
  • bpo-22594: Add a link to the regex module in re documentation #241
  • [3.6] bpo-22594: Add a link to the regex module in re documentation (GH-241) #316
  • [3.5] bpo-22594: Add a link to the regex module in re documentation (GH-241) #317
  • [2.7] bpo-22594: Add a link to the regex module in re documentation (GH-241) #321
  • Files
  • regex-link.patch
  • regex-link.patch
  • regex_reference.patch
  • regex_reference.patch
  • 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']

    @serhiy-storchaka
    Copy link
    Member Author

    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).

    @serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir easy type-feature A feature request or enhancement labels Oct 10, 2014
    @ezio-melotti
    Copy link
    Member

    +1

    @anupamasrinivasmurthy
    Copy link
    Mannequin

    anupamasrinivasmurthy mannequin commented Oct 13, 2014

    I have added the link and attached the patch below. Could you review it?

    Thank you

    @birkenfeld
    Copy link
    Member

    "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
    Copy link
    Mannequin

    anupamasrinivasmurthy mannequin commented Oct 28, 2014

    I have modified the patch and listed the points I know. Could you review it?

    @marco-buttu
    Copy link
    Mannequin

    marco-buttu mannequin commented 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
    Copy link
    Mannequin

    mrabarnett mannequin commented 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
    Copy link
    Mannequin

    marco-buttu mannequin commented 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
    Copy link
    Mannequin

    mrabarnett mannequin commented 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
    Copy link
    Member

    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
    Copy link
    Mannequin

    marco-buttu mannequin commented Feb 8, 2017

    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.

    @mrabarnett
    Copy link
    Mannequin

    mrabarnett mannequin commented 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
    Copy link
    Mannequin

    animalize mannequin commented Feb 9, 2017

    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.
    

    @Mariatta Mariatta added the 3.7 (EOL) end of life label Feb 23, 2017
    @Mariatta
    Copy link
    Member

    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
    Copy link
    Member

    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
    Copy link
    Member

    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
    Copy link
    Member

    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life docs Documentation in the Doc dir easy topic-regex type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants