[issue30457] Allow retrieve the number of waiters pending for most of the asyncio lock primitives

pfreixes report at bugs.python.org
Wed Oct 11 03:36:55 EDT 2017


pfreixes <pfreixes at gmail.com> added the comment:

You are right, having the `pop` after the `set` it would remove the key from the events. Despite the workaround that you proposes is quite clean, it is kinda implicit.

The nature of the `pending` method is to give to the developer a way to check how many waiters are still pending. This not only helps to make this code more explicit also other pieces of code that might need access to the length of the waiters.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30457>
_______________________________________


More information about the Python-bugs-list mailing list