Message89324
| Author |
pitrou |
| Recipients |
benjamin.peterson, conf, ncoghlan, pitrou, trott |
| Date |
2009年06月13日.12:21:49 |
| SpamBayes Score |
5.661759e-06 |
| Marked as misclassified |
No |
| Message-id |
<1244895711.39.0.726471986274.issue5811@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Lucas, it is indeed impossible for peek() to return more than the buffer
size and remain compatible with non-seekable raw streams. That's why it
/never/ returns more than the buffer size.
As for the fact that peek() doesn't behave as documented, I disagree.
Here is what the docstring says:
"""Returns buffered bytes without advancing the position.
The argument indicates a desired minimal number of bytes; we
do at most one raw read to satisfy it. We never return more
than self.buffer_size.
"""
Please note : "a desired /minimal/ number of bytes" (minimal, not
maximal). Furthermore, "We never return more than self.buffer_size." The
behaviour looks ok to me. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年06月13日 12:21:51 | pitrou | set | recipients:
+ pitrou, ncoghlan, benjamin.peterson, trott, conf |
| 2009年06月13日 12:21:51 | pitrou | set | messageid: <1244895711.39.0.726471986274.issue5811@psf.upfronthosting.co.za> |
| 2009年06月13日 12:21:50 | pitrou | link | issue5811 messages |
| 2009年06月13日 12:21:49 | pitrou | create |
|