Re: [Python-ideas] Add function readbyte to asyncio.StreamReader

2018-07-27 Thread Jörn Heissler
On Mon, Jul 23, 2018 at 22:25:14 +0100, Gustavo Carneiro wrote: > Well, even if it is worth, i.e. your use case is not rare enough, Reading a single byte is certainly a special case, but I think it's generic enough to warrant its own function. I believe there should be many binary protocols out th

Re: [Python-ideas] Add function readbyte to asyncio.StreamReader

2018-07-23 Thread Gustavo Carneiro
Well, even if it is worth, i.e. your use case is not rare enough, I would suggest at least making it private, readexactly can call this specialised function if nbytes==1: def _readbyte(self): def readexactly(self, num): if num == 1: return self._readbyte() ... the rest stays th