3.11.0b1 regression: re.template removed without a deprecation period · Issue #92728 · python/cpython (original) (raw)
Bug report
In Python 3.10, the re.template
function exists and is not deprecated:
import re re.template('', re.I) re.compile('', re.TEMPLATE|re.IGNORECASE)
In Python 3.11.0b1 this function is gone:
import re re.template('', re.I) Traceback (most recent call last): File "", line 1, in AttributeError: module 're' has no attribute 'template'
This was removed in b09184bf05 without a depreciation period.
Despite being undocumented, projects actually use this function, see e.g. rpm-software-management/dnf#1827
Please restore this function and deprecate it in 3.11 and 3.12 if you want to remove it in 3.13. (That is how I understand PEP 387, section Making Incompatible Changes.)
Your environment
- CPython versions tested on: 3.11.0b1
- Operating system and architecture: All