[issue32052] Provide access to buffer of asyncio.StreamReader

Bruce Merry report at bugs.python.org
Sat Oct 13 12:13:59 EDT 2018


Bruce Merry <bmerry at gmail.com> added the comment:

A sequence of possible terminators would cover my immediate use case and certainly be an improvement.

To facilitate more general use cases without exposing implementation details, would it be practical and maintainable to have a "putback" method that prepends data to the buffer? It might not be fast in all cases (e.g. it might have to make a copy of what's still in the buffer), but possibly BufferedReader could detect the common case (putting back a suffix of what's just been read) and adjust its offsets into its internal buffer (although I'm not at all familiar with BufferedReader, so feel free to tell me I'm talking nonsense).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32052>
_______________________________________


More information about the Python-bugs-list mailing list