`asyncio.Protocol.data_received` should also accept `bytearray` alongside `bytes`
オープン
まだ誰も着手していません。
topic: asyncio
- 主要言語
- Python
- スター
- 5.1k
- フォーク
- 2.1k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 82
説明
Asyncio's _ProactorReadPipeTransport can also feed bytearray objects in the data_received callback from asyncio.Protocol.
- First,
self._datais abytearrayhere: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L191 - This gets passed to `self._data_received here: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L230
- The passed into
Protocol.data_receivedhere: https://github.com/python/cpython/blob/f8a736b8e14ab839e1193cb1d3955b61c316d048/Lib/asyncio/proactor_events.py#L274
Shall I make a PR with a fix for this?
Related cpython issue: https://github.com/python/cpython/issues/123496 - I'm not sure whether or not it should be fixed in the stdlib instead.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、asyncio.Protocol.data_received の typeshed 宣言を、Lib/asyncio/proactor_events.py に示されているランタイムパスと比較します。特に _ProactorReadPipeTransport と data_received の呼び出しを確認してください。修正を typeshed に入れるべきか判断する前に、関連する CPython issue を確認し、その後、bytearray が表現されるようにアノテーションを更新して、関連する stub チェックが通ることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100