This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Anthony Sottile, dom1310df, ezio.melotti, gvanrossum, malin, mrabarnett, serhiy.storchaka, vstinner
Date 2022-04-02.16:05:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648915508.48.0.0999349816799.issue47152@roundup.psfhosted.org>
In-reply-to
Content
> Is the "import _locale" still used in re/__init__.py? It cannot see any reference to it in the code and test_re still if it's removed.

It is true.

> *Maybe* it's time to consider that re.template() and re.Scanner are no longer experimental? Maybe change their status to alpha or beta? :-D

First we need to find original discussions for these features (it may be not easy) and decide whether we want to finish them or remove.

> In `Modules` folder, there are _sre.c/sre.h/sre_constants.h/sre_lib.h files. Will them be put into a folder?

It is step 2.

> would it be possible to expose `parse_template` -- or at least some way to validate that a regex replacement string is correct prior to executing the replacement?

Maybe, in some form. Currently you can precompile a pattern, but for a replacement string you rely on a LRU cache. It is slower, and limited by the fixed size of the cache. I think it would be worth to add a function for compiling a replacement string. sub() etc should accept both string and a precompiled template object. It is a separate issue.
History
Date User Action Args
2022-04-02 16:05:08serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, vstinner, ezio.melotti, mrabarnett, malin, Anthony Sottile, dom1310df
2022-04-02 16:05:08serhiy.storchakasetmessageid: <1648915508.48.0.0999349816799.issue47152@roundup.psfhosted.org>
2022-04-02 16:05:08serhiy.storchakalinkissue47152 messages
2022-04-02 16:05:08serhiy.storchakacreate