Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue36492

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:Deprecate passing some conflicting arguments by keyword
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: serhiy.storchaka, xtreak
Priority:normalKeywords:patch

Created on2019-03-31 07:17 byserhiy.storchaka, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 12637mergedserhiy.storchaka,2019-03-31 07:36
PR 12645mergedserhiy.storchaka,2019-04-01 07:20
Messages (4)
msg339249 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-03-31 07:17
As Steve mentioned in the discussion aboutPEP 570 [1], some changes of parameters to positional-only are breaking (although there is no breaks in the stdlib code). Before making parameters positional-only we should add a deprecation warning for passing them as keyword arguments. Similarly to the code used in the UserDict constructor (seeissue22609).The following PR adds deprecation warnings for other parameters which should be positional-only. It also fixes bugs about nonavailability to pass special keyword names like "self" or "func". Just one example:>>> import functools>>> def f(self, func): pass... >>> functools.partialmethod(f, func=chr)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: __init__() got multiple values for argument 'func'[1]https://discuss.python.org/t/pep-570-python-positional-only-parameters/1078/53
msg339280 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-04-01 06:16
New changeset42a139ed88c487f325a241c6ee8b308b3c045975 by Serhiy Storchaka in branch 'master':bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)https://github.com/python/cpython/commit/42a139ed88c487f325a241c6ee8b308b3c045975
msg339283 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-04-01 07:59
New changeseta37f356de19828241bf19129f804369794c72ed3 by Serhiy Storchaka in branch '3.7':[3.7]bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645)https://github.com/python/cpython/commit/a37f356de19828241bf19129f804369794c72ed3
msg339284 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-04-01 08:00
Fixes (but not deprecations) were backported to 3.7.
History
DateUserActionArgs
2022-04-11 14:59:13adminsetgithub: 80673
2019-04-01 08:00:55serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: +msg339284

stage: patch review -> resolved
2019-04-01 07:59:29serhiy.storchakasetmessages: +msg339283
2019-04-01 07:20:36serhiy.storchakasetpull_requests: +pull_request12577
2019-04-01 06:16:49serhiy.storchakasetmessages: +msg339280
2019-03-31 07:36:06serhiy.storchakasetkeywords: +patch
stage: patch review
pull_requests: +pull_request12569
2019-03-31 07:34:13xtreaksetnosy: +xtreak
2019-03-31 07:17:26serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp