Skip to content

Remove re.template() and re.TEMPLATE #91367

Description

@serhiy-storchaka
BPO 47211
Nosy @ezio-melotti, @serhiy-storchaka, @animalize
PRs
  • bpo-47211: Remove function re.template() and flag re.TEMPLATE #32300
  • 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 = None
    closed_at = <Date 2022-04-06.17:04:13.978>
    created_at = <Date 2022-04-04.08:56:13.302>
    labels = ['expert-regex', 'type-feature', 'library', '3.11']
    title = 'Remove re.template() and re.TEMPLATE'
    updated_at = <Date 2022-04-06.17:04:13.978>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2022-04-06.17:04:13.978>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-04-06.17:04:13.978>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Regular Expressions']
    creation = <Date 2022-04-04.08:56:13.302>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47211
    keywords = ['patch']
    message_count = 2.0
    messages = ['416658', '416884']
    nosy_count = 4.0
    nosy_names = ['ezio.melotti', 'mrabarnett', 'serhiy.storchaka', 'malin']
    pr_nums = ['32300']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47211'
    versions = ['Python 3.11']

    Activity

    1. serhiy-storchaka commented on Apr 4, 2022

      @serhiy-storchaka
      MemberAuthor

      They were added in 436c3d5 (between 1.6a2 and 2.0), but the purpose is not known. See also https://mail.python.org/archives/list/python-dev@python.org/message/DVSQGM5LO4TK63C63H6KQ6XBTBQGFLEN/. The feature was not fully implemented, and it was disabled short time later in 29c4ba9. Currently the only effect of this flag is that repetition operators (+, *, ?, {}) do not work. A comment was added in 3562f11:

      SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking)

      It's all. I guess it could have some relation to possessive repetition operators, except that it is a global flag.

      I think it should be removed without deprecation because it never really worked and never was documented.

    2. added
      3.11only security fixes
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Apr 4, 2022
    3. serhiy-storchaka commented on Apr 6, 2022

      @serhiy-storchaka
      MemberAuthor

      New changeset b09184b by Serhiy Storchaka in branch 'main':
      bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)
      b09184b

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

    Assignees

    No one assigned

      Labels

      3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-regextype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions