Make `asyncio.Lock.locked()` return `True` when there are waiters
未關閉
還沒有人認領這個 Issue。
stdlib
topic-asyncio
triaged
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
In issue https://github.com/python/cpython/issues/97028 everyone seemed to agree that asyncio.{Lock,Semaphore}.locked() should return True if there are waiters, but this change was implemented only for Semaphore.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-153989
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先閱讀 asyncio.Lock.locked() 以及 asyncio.Semaphore.locked(),然後查看 issue 97028 以了解已達成共識的語意。開始之前檢查已連結的 PR gh-153989,因為其中可能已經包含這項工作;完成條件是:當 lock 有等待者時,Lock.locked() 回傳 True,並提供相應的測試以及針對現有 lock 狀態的行為。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100