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 2016年09月11日 20:29 by ethan.furman, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue-re.stoneleaf.02.patch | ethan.furman, 2016年09月11日 20:29 | review | ||
| Messages (16) | |||
|---|---|---|---|
| msg275848 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2016年09月11日 20:29 | |
Split from issue23591. |
|||
| msg275849 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年09月11日 20:30 | |
New changeset 223731925d06 by Ethan Furman in branch 'default': issue28082: use IntFlag for re constants https://hg.python.org/cpython/rev/223731925d06 |
|||
| msg275860 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2016年09月11日 21:32 | |
Guido, is this something you wanted to happen? I thought you had objected to propagating the four flavors of enum throughout the standard library, particularly for long standing, stable APIs. AFAICT, no one has ever requested this for the re module, nor is there any demonstrated need. As a heavy user of regexes, I've have never looked at the flag values (and if I had, it wouldn't have been helpful to hide that these are integer values rather than giving them both a new type and an unattractive appearance: <Flag.ASCII|IGNORECASE: 258>. Also, prior to this change, the re module and its sre components had no external dependencies and did not require any other modules to be loaded in memory to run. If changes like this do go in, it needs better names (i.e. Flag -> RegexFlag) so that someone using typing doesn't end-up many distinct kinds of integer flags all being called Flag. |
|||
| msg275863 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年09月11日 21:54 | |
New changeset 7369ec91d0f7 by Ethan Furman in branch 'default': issue28082: better name for Flag https://hg.python.org/cpython/rev/7369ec91d0f7 |
|||
| msg275864 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2016年09月11日 21:55 | |
The patch was initially from Serhiy as part of issue23591. So it's safe to say at least one person requested it, and a core dev at that. I will happily make it two people: as an occasional user of re having the constants be named makes it much easier for me to use; I daresay that is true for other occasional users. IIRC giving names to numbers was one of the motivating factors in having Enum in the first place. I do agree that RegexFlag is a better name -- I wasn't real happy with Flag but didn't want to miss the cutoff. |
|||
| msg275865 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年09月11日 22:01 | |
re flags was the primary motive of introducing general IntFlags. This would help to handle frequent user error. Original issue is issue11957. |
|||
| msg275869 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2016年09月11日 22:07 | |
Note: still need to update docs. |
|||
| msg275880 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2016年09月11日 22:44 | |
Yeah, I am generally in favor of this. Just yesterday there was a bug report (#28070) where someone claimed that the flags from r'(ix)A' were incorrect. They were 96 and should be 98. (He was right, and it was fixed already.) The way he had to prove that was rather indirect. If the flags had printed like with this proposal it would have been much more straightforward. |
|||
| msg275881 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2016年09月11日 22:56 | |
Ethan, can you give this class a better name than "Flags"? Perhaps something like "RegexFlags" or somesuch? |
|||
| msg275883 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2016年09月11日 23:01 | |
I did, immediately after your first post -- it's now RegexFlag. Thank you for the suggestion! Naming things can be hard, especially when trying to beat a deadline. |
|||
| msg280257 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2016年11月07日 23:17 | |
The changeset 223731925d06 caused a performance regression: see issue #28637. |
|||
| msg280263 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年11月07日 23:46 | |
New changeset d903a243c281 by Victor Stinner in branch '3.6': Issue #28637: Revert issue #28082, don't import enum in re https://hg.python.org/cpython/rev/d903a243c281 |
|||
| msg280754 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年11月14日 11:40 | |
New changeset 5fd69d4a93e0 by Victor Stinner in branch '3.6': Issue #28637: Reapply changeset 223731925d06 https://hg.python.org/cpython/rev/5fd69d4a93e0 New changeset be66786e95de by Victor Stinner in branch '3.6': Issue #28082: Add basic unit tests on re enums https://hg.python.org/cpython/rev/be66786e95de |
|||
| msg280836 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2016年11月15日 13:34 | |
The change 5fd69d4a93e0 (use IntFlag for re constants) made the "regex_compile" benchmark slower: Median +- std dev: [71c1970f27b6] 388 ms +- 3 ms -> [3cf248d10bed] 470 ms +- 4 ms: 1.21x slower |
|||
| msg281377 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年11月21日 16:31 | |
New changeset 176fc21f8430 by Ethan Furman in branch '3.6': closes issue28082: doc update and NEWS entry https://hg.python.org/cpython/rev/176fc21f8430 |
|||
| msg281380 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年11月21日 16:40 | |
New changeset 493359386360 by Ethan Furman in branch '3.6': issue28082: actually include NEWS entry https://hg.python.org/cpython/rev/493359386360 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:36 | admin | set | github: 72269 |
| 2016年12月08日 18:37:08 | r.david.murray | link | issue28905 superseder |
| 2016年11月21日 16:40:28 | python-dev | set | messages: + msg281380 |
| 2016年11月21日 16:31:14 | python-dev | set | status: open -> closed resolution: fixed messages: + msg281377 stage: commit review -> resolved |
| 2016年11月15日 13:34:09 | vstinner | set | messages: + msg280836 |
| 2016年11月14日 11:40:55 | python-dev | set | messages: + msg280754 |
| 2016年11月07日 23:46:30 | python-dev | set | messages: + msg280263 |
| 2016年11月07日 23:17:43 | vstinner | set | nosy:
+ vstinner messages: + msg280257 |
| 2016年09月11日 23:01:27 | ethan.furman | set | messages: + msg275883 |
| 2016年09月11日 22:57:14 | rhettinger | set | assignee: gvanrossum -> ethan.furman |
| 2016年09月11日 22:57:00 | rhettinger | set | messages: + msg275881 |
| 2016年09月11日 22:44:12 | gvanrossum | set | messages: + msg275880 |
| 2016年09月11日 22:07:26 | ethan.furman | set | messages: + msg275869 |
| 2016年09月11日 22:01:36 | serhiy.storchaka | set | messages: + msg275865 |
| 2016年09月11日 21:55:46 | ethan.furman | set | messages: + msg275864 |
| 2016年09月11日 21:54:46 | python-dev | set | messages: + msg275863 |
| 2016年09月11日 21:32:22 | rhettinger | set | assignee: gvanrossum messages: + msg275860 nosy: + gvanrossum, rhettinger |
| 2016年09月11日 20:30:29 | python-dev | set | nosy:
+ python-dev messages: + msg275849 |
| 2016年09月11日 20:29:30 | ethan.furman | create | |