Improve debugging of the _sre module #106508
Labels
3.13
bugs and security fixes
build
The build process and cross-build
extension-modules
C modules in the Modules dir
topic-regex
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 atmake
, 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. IfVERBOSE == 2
, tracing is always enabled, ifVERBOSE == 0
it is always disabled.This feature is for core developers only.
Linked PRs
The text was updated successfully, but these errors were encountered: