[New-bugs-announce] [issue47211] Remove re.template() and re.TEMPLATE

Serhiy Storchaka report at bugs.python.org
Mon Apr 4 04:56:13 EDT 2022


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

They were added in 436c3d58a2570f3b599e59b4071f944f774ec441 (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 29c4ba9ada44d62988c62c85c8046985f10a1c85. Currently the only effect of this flag is that repetition operators (+, *, ?, {}) do not work. A comment was added in 3562f1176403653ebfbef6275d449ad42d1b843a:

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.

----------
components: Library (Lib), Regular Expressions
messages: 416658
nosy: ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove re.template() and re.TEMPLATE
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47211>
_______________________________________


More information about the New-bugs-announce mailing list