Steven D'Aprano wrote:
[snip]
An example from the standard library: the re module defines constants I,
L, M, etc. representing flags that are passed to the re.compile. They are
implemented as integers so they can easily be combined with &, but
another implementation might use symbols. You will notice that they're
not limited to the re.compile function itself.
The caller may very well want to do something like this:
# Get some flags for compile:
flags = re.I & re.M
[snip]
That should be:
flags = re.I | re.M
of course. :-)
--
http://mail.python.org/mailman/listinfo/python-list