[issue47152] Reorganize the re module sources

STINNER Victor report at bugs.python.org
Fri Apr 1 04:17:23 EDT 2022


STINNER Victor <vstinner at python.org> added the comment:

sre_constants, sre_compile and sre_parse are not tested and are not documented. I don't consider them as public API currently.

If someone has good reason to use them, IMO we must clearly define which exact API is needed, properly document and test it.

If we expose something, I don't think that the API would be exposed as re.sre_xxx.xxx, but as re.xxx. 

I suggest to hide sre_xxx submodules by adding an underscore to their name. Moreover, the "sre_" prefix is now redundant. I suggest renaming:

* sre_constants => re._constants
* sre_compile => re._compile
* sre_parse => re._parse

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47152>
_______________________________________


More information about the Python-bugs-list mailing list