Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue29195

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Get rid of supporting outdated wrong keyword arguments in re methods
Type:enhancementStage:resolved
Components:Extension ModulesVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: python-dev, rhettinger, serhiy.storchaka
Priority:normalKeywords:patch

Created on2017-01-07 12:04 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
re_wrong_string_argument_name.patchserhiy.storchaka,2017-01-07 12:04review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (4)
msg284911 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)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)*(Python committer)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)*(Python committer)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)(Python triager)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
DateUserActionArgs
2022-04-11 14:58:41adminsetgithub: 73381
2017-03-31 16:36:15dstufftsetpull_requests: +pull_request901
2017-01-13 07:02:34serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-01-13 06:54:18python-devsetnosy: +python-dev
messages: +msg285362
2017-01-08 21:48:17serhiy.storchakasetmessages: +msg285009
2017-01-08 05:19:56rhettingersetnosy: +rhettinger
messages: +msg284963
2017-01-07 12:04:53serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp