Skip to content

Wrong keyword parameter name in regex pattern methods #64482

Closed

Description

@serhiy-storchaka
BPO 20283
Nosy @loewis, @birkenfeld, @terryjreedy, @pitrou, @vstinner, @taleinat, @larryhastings, @benjaminp, @ezio-melotti, @serhiy-storchaka
Files
  • sre_pattern_string_keyword.patch: The "hard" patch
  • sre_deprecate_pattern_keyword.patch: The "soft" patch
  • sre_deprecate_pattern_keyword-3.4.patch
  • sre_deprecate_pattern_keyword-3.4_2.patch
  • test_re_keyword_parameters.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/serhiy-storchaka'
    closed_at = <Date 2014-03-06.11:32:19.090>
    created_at = <Date 2014-01-16.20:44:27.414>
    labels = ['type-bug', 'library']
    title = 'Wrong keyword parameter name in regex pattern methods'
    updated_at = <Date 2014-03-06.11:32:19.090>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-03-06.11:32:19.090>
    actor = 'Arfrever'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-03-06.11:32:19.090>
    closer = 'Arfrever'
    components = ['Library (Lib)']
    creation = <Date 2014-01-16.20:44:27.414>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['33598', '33721', '34216', '34280', '34290']
    hgrepos = []
    issue_num = 20283
    keywords = ['patch']
    message_count = 26.0
    messages = ['208311', '208375', '208689', '208743', '209229', '209264', '209289', '209291', '209302', '209303', '209304', '209305', '210676', '210734', '210735', '212140', '212619', '212672', '212674', '212677', '212712', '212752', '212753', '212769', '212800', '212803']
    nosy_count = 13.0
    nosy_names = ['loewis', 'georg.brandl', 'terry.reedy', 'pitrou', 'vstinner', 'taleinat', 'larry', 'benjamin.peterson', 'ezio.melotti', 'mrabarnett', 'Arfrever', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20283'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    Activity

    1. larryhastings commented on Feb 9, 2014

      @larryhastings
      Contributor

      Use #3.

    2. larryhastings commented on Feb 9, 2014

      @larryhastings
      Contributor

      "pattern" should be keyword-only, and if used the function should generate a DeprecationWarning.

    3. serhiy-storchaka commented on Feb 24, 2014

      @serhiy-storchaka
      MemberAuthor

      Here is a patch with the show_in_signature hack for 3.4.

    4. loewis commented on Mar 3, 2014

      loewismannequin
      Mannequin

      The patch sre_deprecate_pattern_keyword-3.4.patch looks good to me. I *think* that Larry has pre-approved it for 3.4.

      If it is applied, and if people still think that 2.7 and 3.3 need to be changed, the release-critical status should be removed from the issue.

    5. serhiy-storchaka commented on Mar 3, 2014

      @serhiy-storchaka
      MemberAuthor

      The disadvantage of sre_deprecate_pattern_keyword-3.4.patch is that it creates
      false signature for SRE_Pattern.match(). Default value of first argument is
      exposed as None, but actually this parameter is mandatory and None is not
      valid value for it. I afraid the only way to get rid of false signature (and
      keep backward compatibility) is to revert converting to Argument Clinic. And
      here is a patch which do this.

    6. larryhastings commented on Mar 3, 2014

      @larryhastings
      Contributor

      Why can't you remove the "= NULL" from the Clinic input for "string"?

    7. serhiy-storchaka commented on Mar 3, 2014

      @serhiy-storchaka
      MemberAuthor

      Why can't you remove the "= NULL" from the Clinic input for "string"?

      Because this will prohibit the use of "pattern" as keyword argument.

    8. vstinner commented on Mar 4, 2014

      @vstinner
      Member

      We are close to Python 3.4 final, so what is the status of this issue? I don't see any commit and nothing to cherry-pick in Larry's 3.4.0 repository.

    9. loewis commented on Mar 4, 2014

      loewismannequin
      Mannequin

      Since there is no consensus on how to resolve this issue, I'm dropping the release-critical status for it; people should now consider whether a future agreed-upon solution could apply to 3.4.1 or just to 3.5.

    10. loewis commented on Mar 4, 2014

      loewismannequin
      Mannequin

      Serhiy: the patch is incomplete; it lacks test cases.

    11. serhiy-storchaka commented on Mar 5, 2014

      @serhiy-storchaka
      MemberAuthor

      Here is a test.

    12. python-dev commented on Mar 6, 2014

      python-devmannequin
      Mannequin

      New changeset 52743dc788e6 by Serhiy Storchaka in branch '3.3':
      Issue bpo-20283: RE pattern methods now accept the string keyword parameters
      http://hg.python.org/cpython/rev/52743dc788e6

      New changeset f4d7abcf8080 by Serhiy Storchaka in branch 'default':
      Issue bpo-20283: RE pattern methods now accept the string keyword parameters
      http://hg.python.org/cpython/rev/f4d7abcf8080

    13. python-dev commented on Mar 6, 2014

      python-devmannequin
      Mannequin

      New changeset 52256a5861fa by Serhiy Storchaka in branch '2.7':
      Issue bpo-20283: RE pattern methods now accept the string keyword parameters
      http://hg.python.org/cpython/rev/52256a5861fa

    14. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    stdlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions