Message240247
Sounds like this might be more appropriate for the BufferedReader and related classes, and less so for the writer and abstract base class.
The proposed API seems strange to me. Is there an illustration of how it might be used? I suspect it wouldn’t be all that useful, and could more or less be implemented with the existing methods:
def prefetch(buffered_reader, buffer, skip, minread):
buffered_reader.read(skip)
consumed = buffered_reader.readinto(buffer[:minread])
if consumed < minread:
return consumed
spare = len(buffer) - consumed
extra = buffered_reader.peek(spare)[:spare]
total = consumed + len(extra)
buffer[consumed:total] = extra
return total
Maybe it would be better to focus on clarifying or redefining the existing peek() method (Issue 5811), rather than making a brand new do-everything method which only seems to do what the other methods already do. |
|
Date |
User |
Action |
Args |
2015-04-08 03:34:21 | martin.panter | set | recipients:
+ martin.panter, pitrou, vstinner, nadeem.vawda, benjamin.peterson, stutzbach, jcon, serhiy.storchaka |
2015-04-08 03:34:20 | martin.panter | set | messageid: <1428464060.98.0.57196964756.issue12053@psf.upfronthosting.co.za> |
2015-04-08 03:34:20 | martin.panter | link | issue12053 messages |
2015-04-08 03:34:20 | martin.panter | create | |
|