[issue32052] Provide access to buffer of asyncio.StreamReader

2019-06-03 Thread Bruce Merry
Bruce Merry added the comment: Ok, I'll open a separate issue to allow a tuple of possible separators. -- nosy: +bmerry ___ Python tracker ___

[issue32052] Provide access to buffer of asyncio.StreamReader

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: Closing. Brief: 1. Access to an internal buffer is not an option. 2. Pushing data back to stream after fetching is not an option too: it kills almost any possible optimization and makes code overcomplicated. aiohttp used to have "unread_data()" API but we dep

[issue32052] Provide access to buffer of asyncio.StreamReader

2018-10-13 Thread Bruce Merry
Bruce Merry 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

[issue32052] Provide access to buffer of asyncio.StreamReader

2018-10-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Exposing internal buffer means committing on a new API contract forever. I feel a need for reacher read*() API but pretty sure that making internal buffer public is a bad idea. With BufferedProtocol it could be even worse: SLAB allocators can spit a buffer i

[issue32052] Provide access to buffer of asyncio.StreamReader

2018-10-12 Thread Yury Selivanov
Yury Selivanov added the comment: So we have BufferedProtocol in 3.7; now we need to re-implement asyncio streams on top of it. But even after doing that I'm not that sure we want to expose the low-level buffer. -- stage: needs patch -> ___ Pyth

[issue32052] Provide access to buffer of asyncio.StreamReader

2018-10-12 Thread Cheryl Sabella
Change by Cheryl Sabella : -- dependencies: +Add asyncio.BufferedProtocol stage: -> needs patch versions: +Python 3.8 -Python 3.7 ___ Python tracker ___ __

[issue32052] Provide access to buffer of asyncio.StreamReader

2017-12-20 Thread Yury Selivanov
Yury Selivanov added the comment: I'd be more comfortable with the idea of exposing the buffer when we have BufferedProtocol. Let's wait on this one. -- ___ Python tracker __

[issue32052] Provide access to buffer of asyncio.StreamReader

2017-12-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: If the problm is in readuntil() functionality -- let's discuss th function improvement (in separate issue). Exposing streams internals is antipattern and very bad idea. I suggest closing the issue. Yury, what is your opinion? -- nosy: +asvetlov

[issue32052] Provide access to buffer of asyncio.StreamReader

2017-11-16 Thread Bruce Merry
New submission from Bruce Merry : While asyncio.StreamReader.readuntil is an improvement on only having readline, it is still quite limited e.g. you cannot have multiple possible terminators. The real problem is that it's not possible to roll your own without accessing _underscore fields (othe