Repository navigation
Closed
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/serhiy-storchaka'
closed_at = <Date 2014-03-06.11:32:19.090>
created_at = <Date 2014-01-16.20:44:27.414>
labels = ['type-bug', 'library']
title = 'Wrong keyword parameter name in regex pattern methods'
updated_at = <Date 2014-03-06.11:32:19.090>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2014-03-06.11:32:19.090>
actor = 'Arfrever'
assignee = 'serhiy.storchaka'
closed = True
closed_date = <Date 2014-03-06.11:32:19.090>
closer = 'Arfrever'
components = ['Library (Lib)']
creation = <Date 2014-01-16.20:44:27.414>
creator = 'serhiy.storchaka'
dependencies = []
files = ['33598', '33721', '34216', '34280', '34290']
hgrepos = []
issue_num = 20283
keywords = ['patch']
message_count = 26.0
messages = ['208311', '208375', '208689', '208743', '209229', '209264', '209289', '209291', '209302', '209303', '209304', '209305', '210676', '210734', '210735', '212140', '212619', '212672', '212674', '212677', '212712', '212752', '212753', '212769', '212800', '212803']
nosy_count = 13.0
nosy_names = ['loewis', 'georg.brandl', 'terry.reedy', 'pitrou', 'vstinner', 'taleinat', 'larry', 'benjamin.peterson', 'ezio.melotti', 'mrabarnett', 'Arfrever', 'python-dev', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue20283'
versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']
Activity
larryhastings commentedon Feb 9, 2014
Use #3.
larryhastings commentedon Feb 9, 2014
"pattern" should be keyword-only, and if used the function should generate a DeprecationWarning.
serhiy-storchaka commentedon Feb 24, 2014
Here is a patch with the show_in_signature hack for 3.4.
loewis commentedon Mar 3, 2014
The patch sre_deprecate_pattern_keyword-3.4.patch looks good to me. I *think* that Larry has pre-approved it for 3.4.
If it is applied, and if people still think that 2.7 and 3.3 need to be changed, the release-critical status should be removed from the issue.
serhiy-storchaka commentedon Mar 3, 2014
The disadvantage of sre_deprecate_pattern_keyword-3.4.patch is that it creates
false signature for SRE_Pattern.match(). Default value of first argument is
exposed as None, but actually this parameter is mandatory and None is not
valid value for it. I afraid the only way to get rid of false signature (and
keep backward compatibility) is to revert converting to Argument Clinic. And
here is a patch which do this.
larryhastings commentedon Mar 3, 2014
Why can't you remove the "= NULL" from the Clinic input for "string"?
serhiy-storchaka commentedon Mar 3, 2014
Because this will prohibit the use of "pattern" as keyword argument.
vstinner commentedon Mar 4, 2014
We are close to Python 3.4 final, so what is the status of this issue? I don't see any commit and nothing to cherry-pick in Larry's 3.4.0 repository.
loewis commentedon Mar 4, 2014
Since there is no consensus on how to resolve this issue, I'm dropping the release-critical status for it; people should now consider whether a future agreed-upon solution could apply to 3.4.1 or just to 3.5.
loewis commentedon Mar 4, 2014
Serhiy: the patch is incomplete; it lacks test cases.
serhiy-storchaka commentedon Mar 5, 2014
Here is a test.
python-dev commentedon Mar 6, 2014
New changeset 52743dc788e6 by Serhiy Storchaka in branch '3.3':
Issue bpo-20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/52743dc788e6
New changeset f4d7abcf8080 by Serhiy Storchaka in branch 'default':
Issue bpo-20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/f4d7abcf8080
python-dev commentedon Mar 6, 2014
New changeset 52256a5861fa by Serhiy Storchaka in branch '2.7':
Issue bpo-20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/52256a5861fa