[issue13385] Add an explicit re.NOFLAGS flag value to the re module

Eli Bendersky report at bugs.python.org
Fri Nov 11 20:39:16 CET 2011


New submission from Eli Bendersky <eliben at gmail.com>:

The flags 're' accept are numeric underneath, and the current value of "no flags" is just 0, which is also specified in the documentation as the default value. However, using raw numeric values is not a good programming practice. 

The suggestion is to add a simple re.NOFLAGS constant to the 're' module with the value of 0, and use it in the documentation instead of plain 0. It's a simple change that won't break anything and may provide better readability for some code, as well as remove the need for plain integer references in the documentation.

See also issues #11957 and #12875.

Adding to nosy people taking part in discussion of the aforementioned issue. If you're not interested, please remove yourself - I apologize in advance.

----------
components: Library (Lib), Regular Expressions
messages: 147443
nosy: eli.bendersky, eric.araujo, eric.smith, ezio.melotti, terry.reedy
priority: normal
severity: normal
status: open
title: Add an explicit re.NOFLAGS flag value to the re module
versions: Python 3.3

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


More information about the Python-bugs-list mailing list