msg155362 - (view) |
Author: py.user (py.user) * |
Date: 2012-03-11 00:46 |
http://docs.python.org/py3k/library/re.html#re.regex.flags "or 0 if no flags were provided" >>> import re >>> p = re.compile(r'', 0) >>> p.flags 32 >>> |
|
|
msg155363 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-03-11 02:01 |
32 is re.U, which is always ored with the passed in flags, unless re.A is set in the passed in flags. The flag docs should certinaly be updated to reflect this. |
|
|
msg155558 - (view) |
Author: py.user (py.user) * |
Date: 2012-03-13 02:17 |
>>> import re >>> p = re.compile(br'') >>> p.flags 0 >>> |
|
|
msg155559 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-03-13 02:20 |
Heh. Good point. Documenting this is a clear way may be non-trivial. |
|
|
msg155561 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2012-03-13 02:55 |
Issue #13358 may be related |
|
|
msg155562 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-03-13 03:03 |
It doesn't look like it. Is that the right issue number? |
|
|
msg155564 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2012-03-13 03:18 |
Oh, sorry I meant http://bugs.python.org/issue13385 |
|
|
msg155727 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2012-03-14 06:58 |
There is even more wrongness here: if you give flags inline in the pattern, they also show up in .flags (since they are global, at least in the current implementation). Suggested patch attached. |
|
|
msg156172 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-03-17 16:29 |
New changeset b3b3a4a7d7b2 by Georg Brandl in branch '3.2': Closes #14250: regex.flags has not only explicit flags but also implicit flags and those from the pattern http://hg.python.org/cpython/rev/b3b3a4a7d7b2 |
|
|
msg156173 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-03-17 16:31 |
New changeset ac00531a63aa by Georg Brandl in branch '2.7': Closes #14250: regex.flags has not only explicit flags but also those from the pattern http://hg.python.org/cpython/rev/ac00531a63aa |
|
|