A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-June/090081.html below:

[Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

[Python-Dev] io.BufferedReader.peek() Behaviour in python3.1 [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1Lucas P Melo lukepadawan at gmail.com
Tue Jun 16 15:14:08 CEST 2009
MRAB wrote:
> I was thinking along the lines of:
>
>     def peek(self, size=None, block=True)
I think this is fine too. :)

>
> If 'block' is True then return 'size' bytes, unless the end of the
> file/stream is reached; if 'block' is False then return up to 'size'
> bytes, without blocking. The blocking form might impose a limit to how 
> much can be peeked (the maximum size of the buffer), or it might enlarge
> the buffer as necessary.
I guess the limit wouldn't be a problem to someone that chose to block 
further reads.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4