Symbols as parameters?
steve at REMOVE-THIS-cybersource.com.au
Fri Jan 22 04:08:57 CET 2010
On Fri, 22 Jan 2010 02:42:55 +0000, MRAB wrote:
> Steven D'Aprano wrote:
>> 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
> That should be:
> flags = re.I | re.M
> of course. :-)
Dammit! No wonder my regexes never work as I expect!!!
Thanks for the correction.
More information about the Python-list