This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年03月11日 00:46 by py.user, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| regexflags.patch | georg.brandl, 2012年03月14日 06:58 | review | ||
| Messages (10) | |||
|---|---|---|---|
| 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | Date: 2012年03月13日 02:55 | |
Issue #13358 may be related |
|||
| msg155562 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | 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) * (Python committer) | Date: 2012年03月13日 03:18 | |
Oh, sorry I meant http://bugs.python.org/issue13385 |
|||
| msg155727 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | 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) (Python triager) | 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) (Python triager) | 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 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58458 |
| 2012年03月17日 16:31:32 | python-dev | set | messages: + msg156173 |
| 2012年03月17日 16:29:44 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg156172 resolution: fixed stage: patch review -> resolved |
| 2012年03月17日 04:39:18 | eli.bendersky | set | nosy:
- eli.bendersky |
| 2012年03月16日 19:03:57 | terry.reedy | set | stage: needs patch -> patch review |
| 2012年03月14日 06:58:19 | georg.brandl | set | files:
+ regexflags.patch nosy: + georg.brandl messages: + msg155727 keywords: + patch |
| 2012年03月13日 03:18:41 | eli.bendersky | set | messages: + msg155564 |
| 2012年03月13日 03:03:20 | r.david.murray | set | messages: + msg155562 |
| 2012年03月13日 02:55:44 | eli.bendersky | set | nosy:
+ eli.bendersky messages: + msg155561 |
| 2012年03月13日 02:20:36 | r.david.murray | set | messages: + msg155559 |
| 2012年03月13日 02:17:01 | py.user | set | messages:
+ msg155558 title: regex.flags is never equal to 0 -> for string patterns regex.flags is never equal to 0 |
| 2012年03月12日 00:32:26 | benjamin.peterson | set | keywords: + easy |
| 2012年03月11日 10:21:09 | eric.araujo | set | nosy:
+ eric.araujo |
| 2012年03月11日 02:01:12 | r.david.murray | set | versions:
+ Python 3.3 nosy: + r.david.murray messages: + msg155363 stage: needs patch |
| 2012年03月11日 00:46:31 | py.user | create | |