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.

classification
Title: Simplify handling of removed parameter "loop" in asyncio
Type: Stage: resolved
Components: asyncio Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, serhiy.storchaka, yselivanov
Priority: normal Keywords: patch

Created on 2022-02-19 07:56 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31431 merged serhiy.storchaka, 2022-02-19 07:57
Messages (2)
msg413539 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-19 07:56
Before 3.10 many asyncio classes did have an optional parameter "loop". It was deprecated in 3.8. To simplify the code, such classes inherited a constructor from _LoopBoundMixin which set the _loop attribute and (since 3.8) emitted a warning if the loop argument was passed. Since 3.10 the _LoopBoundMixin no longer sets the _loop attribute and always raises a TypeError if the loop argument is passed.

The same effect can be achieved if just remove the loop parameter (and the _LoopBoundMixin constructor as it will do nothing). The only difference in the error message: it will be standard "Lock.__init__() got an unexpected keyword argument 'loop'" instead of "As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary". Usually we do not keep specialized error messages for removed parameters.
msg413646 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2022-02-21 11:26
New changeset 195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca by Serhiy Storchaka in branch 'main':
bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)
https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90952
2022-02-21 11:26:34asvetlovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-21 11:26:02asvetlovsetmessages: + msg413646
2022-02-19 07:57:14serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request29566
2022-02-19 07:56:05serhiy.storchakacreate