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

Eli Bendersky report at bugs.python.org
Sat Nov 12 04:23:48 CET 2011


Eli Bendersky <eliben at gmail.com> added the comment:

Antoine, what's the outcome of people wondering about the difference? I don't see what's bad about it, it's not as if people are writing (or supposed to write) code that does arithmetic on these flag values. Their only usage is to:

1. Provide no flags
2. Provide a single flag
3. Provide a few flags ORed together

The "OR" (which makes no mathematical sense in this case) is bad enough, but why not provide an easy fix for (1), making it explicit instead of implicit. I think we sometimes forget that not everyone who picks up Python is an old C dog, familiar with these tricks. To newbies for whom Python is the first language, these flags aren't very intuitive to use, I imagine.

----------

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


More information about the Python-bugs-list mailing list