![](https://secure.gravatar.com/avatar/2dde9ab55441548a981af3e43639fcbd.jpg?s=120&d=mm&r=g)
On Thu, Apr 29, 2021 at 1:20 PM Ethan Furman <ethan@stoneleaf.us> wrote:
An excerpt from bpo-31369: re.RegexFlag and `__all__`
One thing I discovered when developing this example: there doesn't seem to be a flag to represent 0 (zero), i.e. "no flags". And foo(0) is a type error (even
GvR: ---- though it works
fine at runtime).
Which raises the question: Do we want to have a standard name for stdlib Flags when no flags are set?
What should we call it?
- NONE
- ZERO
- EMPTY
- ???
If you want a flag to represent no flags set, it takes one line to write it yourself, as in this example I copied verbatim from the docs:
class Color(Flag): ... BLACK = 0 ... RED = auto() ... BLUE = auto() ... GREEN = auto() ... Color.BLACK <Color.BLACK: 0> bool(Color.BLACK) False