gh-99941: asyncio.Protocol.data_received now received immutable bytes by DarioDaF · Pull Request #100053 · python/cpython
Made asyncio.Protocol.data_received receive immutable object
bytes instead of bytearrays (like defined in the docs) with regression tests added
and opted to use memoryview to take the slices for performance on big buffers.
Performance test from #21442 done on my machine with 10
repetitions on release build with timings 0.043 (delta: 0.019) before patch
and 0.041 (delta: 0.010) after so no noticable change in performance.