[issue43524] Addition of peek and peekexactly methods to asyncio.StreamReader

2021-03-16 Thread Awal Garg
Awal Garg added the comment: P.S., I've filed this issue after a brief discussion in #python and following this ticket https://bugs.python.org/issue32052 which asks for exposing the internal buffer as is. Obviously, peek methods don't need to expose the buffer and only provide

[issue43524] Addition of peek and peekexactly methods to asyncio.StreamReader

2021-03-16 Thread Awal Garg
New submission from Awal Garg : I propose the addition of the following methods to asyncio.StreamReader: > coroutine peek(n=-1) > Same as read, but does not remove the returned data from the internal buffer. > > coroutine peekexactly(n) > Same as readexactly, but does not remo