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 dom1310df
Recipients dom1310df, ezio.melotti, gvanrossum, malin, mrabarnett, serhiy.storchaka
Date 2022-03-29.21:08:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648588115.85.0.884523693297.issue47152@roundup.psfhosted.org>
In-reply-to
Content
Could the sre_parse and sre_constants modules be kept with public names (i.e. without the leading underscore) but within the re namespace? I use them to tokenize and then syntax highlight regular expressions.

I did a quick search and found a few other users of the modules:

* pydoctor uses them for regex syntax highlighting[1], although it has its own copy of the sre_parse source rather than importing from stdlib.
* lark uses sre_parse to find minimum and maximum length of matching strings[2]
* sre_yield uses them to determine all strings that will match a regex[3]

The whole modules don't necessarily need exposing, but certainly sre_parse.parse, sre_parse.parse_template, and the opcodes from sre_constants would be the most useful.


[1] https://github.com/twisted/pydoctor/blob/c86273dffade5455890570142c8b7b068f5dffd1/pydoctor/epydoc/markup/_pyval_repr.py#L776
[2] https://github.com/lark-parser/lark/blob/85ea92ebf4e983e9997f9953a9c1463bb3d1c6cc/lark/utils.py#L120
[3] https://github.com/google/sre_yield/blob/3af063a0054c4646608b43b941fbfcbe4e01214a/sre_yield/__init__.py
History
Date User Action Args
2022-03-29 21:08:35dom1310dfsetrecipients: + dom1310df, gvanrossum, ezio.melotti, mrabarnett, serhiy.storchaka, malin
2022-03-29 21:08:35dom1310dfsetmessageid: <1648588115.85.0.884523693297.issue47152@roundup.psfhosted.org>
2022-03-29 21:08:35dom1310dflinkissue47152 messages
2022-03-29 21:08:35dom1310dfcreate