
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-01-07 12:04 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| re_wrong_string_argument_name.patch | serhiy.storchaka,2017-01-07 12:04 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft,2017-03-31 16:36 | |
| Messages (4) | |||
|---|---|---|---|
| msg284911 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-01-07 12:04 | |
Many re methods accepted the string parameter as a keyword argument by wrong name. This was fixed inissue20283. Wrong keyword names were still accepted, but a deprecation warning was emitted if use them. Proposed patch finishes the deprecation period (started since 3.4) and removes the support of wrong names.Python 2.7.7, 3.3.6, 3.4-3.6:>>> import re>>> re.compile('.').match(pattern='a')__main__:1: DeprecationWarning: The 'pattern' keyword parameter name is deprecated. Use 'string' instead.<_sre.SRE_Match object; span=(0, 1), match='a'>>>> re.compile('.').match(string='a')<_sre.SRE_Match object; span=(0, 1), match='a'>Python 3.7:>>> re.compile('.').match(pattern='a')Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: Required argument 'string' (pos 1) not found | |||
| msg284963 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2017-01-08 05:19 | |
It's too bad that "pattern" lost out to the less informative "string".+1 for finishing the work and applying this patch. | |||
| msg285009 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-01-08 21:48 | |
"pattern" is not more informative, it is just wrong. The argument of the match() method is not a pattern, it is a string with which a pattern is matched. | |||
| msg285362 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2017-01-13 06:54 | |
New changesetf8678135c042 by Serhiy Storchaka in branch 'default':Issue#29195: Removed support of deprecated undocumented keyword argumentshttps://hg.python.org/cpython/rev/f8678135c042 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:41 | admin | set | github: 73381 |
| 2017-03-31 16:36:15 | dstufft | set | pull_requests: +pull_request901 |
| 2017-01-13 07:02:34 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-01-13 06:54:18 | python-dev | set | nosy: +python-dev messages: +msg285362 |
| 2017-01-08 21:48:17 | serhiy.storchaka | set | messages: +msg285009 |
| 2017-01-08 05:19:56 | rhettinger | set | nosy: +rhettinger messages: +msg284963 |
| 2017-01-07 12:04:53 | serhiy.storchaka | create | |