`asyncio.Protocol.data_received` should also accept `bytearray` alongside `bytes`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 2.1k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 82
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die typeshed-Deklaration für asyncio.Protocol.data_received mit dem in Lib/asyncio/proactor_events.py gezeigten Laufzeitpfad zu vergleichen, insbesondere _ProactorReadPipeTransport und den Aufruf von data_received. Prüfe das zugehörige CPython-Issue, bevor du entscheidest, ob die Korrektur in typeshed vorgenommen werden sollte, aktualisiere dann die Annotation so, dass bytearray dargestellt wird, und verifiziere, dass die relevanten Stub-Prüfungen erfolgreich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100