Guido van Rossum added the comment:

Hm.  I think there are two different situations.

One is where the app creates a socket (or other I/O thingie), passes it off to 
asyncio, and then asyncio owns it.  This is the case for pipes and also for the 
optional sock parameter for create_connection().  In these cases I think it is 
more robust of asyncio configures the FD for its own needs.

The other case is where the app and asyncio share the socket.  This is the case 
for e.g. sock_recv().  In this case I think it should be the app's 
responsibility to configure it properly.  Asyncio can check in debug mode, but 
otherwise it may be too expensive to check.  (Checking a socket object is 
actually fine, just check that gettimeout() returns 0; but checking a FD would 
require a syscall so don't do that in debug mode.)

So the docs for connect_write_pipe() have a bug. :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22063>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to