[issue28082] re: convert re flags to (much friendlier) IntFlag constants

Raymond Hettinger report at bugs.python.org
Sun Sep 11 17:32:22 EDT 2016


Raymond Hettinger added the comment:

Guido, is this something you wanted to happen?  I thought you had objected to propagating the four flavors of enum throughout the standard library, particularly for long standing, stable APIs.

AFAICT, no one has ever requested this for the re module, nor is there any demonstrated need.  As a heavy user of regexes, I've have never looked at the flag values (and if I had, it wouldn't have been helpful to hide that these are integer values rather than giving them both a new type and an unattractive appearance:  <Flag.ASCII|IGNORECASE: 258>.  Also,  prior to this change, the re module and its sre components had no external dependencies and did not require any other modules to be loaded in memory to run.

If changes like this do go in, it needs better names (i.e. Flag -> RegexFlag) so that someone using typing doesn't end-up many distinct kinds of integer flags all being called Flag.

----------
assignee:  -> gvanrossum
nosy: +gvanrossum, rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28082>
_______________________________________


More information about the Python-bugs-list mailing list