diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-25 06:32:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 06:32:20 (GMT) |
commit | 74b205b3eb6432d81d745da1dae4359e42ae76d4 (patch) | |
tree | f8c35e40543963fbc51066a94cde7b3425ba01ef /Lib/re/_parser.py | |
parent | 7a5f190c9fa7c6cbd334dfea9ae6032ac886dd89 (diff) | |
download | cpython-74b205b3eb6432d81d745da1dae4359e42ae76d4.zip cpython-74b205b3eb6432d81d745da1dae4359e42ae76d4.tar.gz cpython-74b205b3eb6432d81d745da1dae4359e42ae76d4.tar.bz2 |
gh-92728: Restore re.template, but deprecate it (GH-93161)
Revert "bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)"
This reverts commit b09184bf05b07b77c5ecfedd4daa846be3cbf0a9.
(cherry picked from commit 16a7e4a0b75080275bf12cfb71d54b01d85099b2)
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
Diffstat (limited to 'Lib/re/_parser.py')
-rw-r--r-- | Lib/re/_parser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/re/_parser.py b/Lib/re/_parser.py index a393c50..f747a03 100644 --- a/Lib/re/_parser.py +++ b/Lib/re/_parser.py @@ -61,11 +61,12 @@ FLAGS = { "x": SRE_FLAG_VERBOSE, # extensions "a": SRE_FLAG_ASCII, + "t": SRE_FLAG_TEMPLATE, "u": SRE_FLAG_UNICODE, } TYPE_FLAGS = SRE_FLAG_ASCII | SRE_FLAG_LOCALE | SRE_FLAG_UNICODE -GLOBAL_FLAGS = SRE_FLAG_DEBUG +GLOBAL_FLAGS = SRE_FLAG_DEBUG | SRE_FLAG_TEMPLATE class State: # keeps track of state for parsing |