Not sure I follow, but yeah: select reports the state of the file-descriptor.  While the descriptor is readable, every call to select will indicate that it's readable, etc. 

Shane Green
805-452-9666 |

On Oct 14, 2012, at 5:48 AM, Richard Oudkerk <> wrote:

On 14/10/2012 6:29am, Greg Ewing wrote:
Not sure if this is relevant, but I'd just like to point out
that the behaviour of select() in this respect is actually
*edge triggered* by this definition. Once it has reported that
a given file descriptor is ready, it *won't* report that file
descriptor again until you do something with it. This can be
a subtle source of bugs in select-based code if you're not
aware of it.

Unless I have misunderstood you, the following example contradicts that:

>>> import os, select
>>> r, w = os.pipe()
>>> os.write(w, b"hello")
>>>[r], [], [])
([3], [], [])
>>>[r], [], [])
([3], [], [])


Python-ideas mailing list