Description
If macro VERBOSE is defined during compiling the _sre
module, debugging prints are added which help to debug internals of the regular expression engine. Unfortunately, it is a global option which affects evaluation of every regular expression. Since some Python code which uses regular expressions is executed at make
, it makes building much more slower. Also, some regular expressions are used at the REPR startup, which adds a lot of noise. It makes this feature almost not usable.
The proposed PR allows to enable tracing on per-pattern basis. If macro VERBOSE == 1
, tracing is only enabled for patterns compiled with the DEBUG flag. If VERBOSE == 2
, tracing is always enabled, if VERBOSE == 0
it is always disabled.
This feature is for core developers only.