Re: pep 3116 behaviour on non-blocking reads
- From: greg <greg@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 10 Aug 2007 20:58:40 +1200
Antoon Pardon wrote:
I would like the developers to reconsider and return 0 bytes when no
bytes are available and let None indicate end of file.
That would be a major departure from the way IO has
always been handled before in Python, which follows
the Unix model.
Also, only code that deals with non-blocking streams
will ever get None, and such code is relatively rare,
so most code won't have to worry about the None case.
Even when dealing with a non-blocking stream, usually
there will be some other way (such as select) used to
determine when there is something to be read from a
stream, and it won't be read otherwise. In that case,
the code *still* won't ever see a None.
So I think the PEP has it right.
--
Greg
.
- References:
- pep 3116 behaviour on non-blocking reads
- From: Antoon Pardon
- pep 3116 behaviour on non-blocking reads
- Prev by Date: Re: Misleading wikipedia article on Python 3?
- Next by Date: subprocess.Popen(cmd) question
- Previous by thread: pep 3116 behaviour on non-blocking reads
- Next by thread: Jython - variables are stored somehow
- Index(es):