New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

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.

----------
components: asyncio
messages: 413539
nosy: asvetlov, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Simplify handling of removed parameter "loop" in asyncio
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46796>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to