Mercurial > cpython-lru_cache-weakref
diff Lib/socket.py @ 64759:7ef5c6be7232
Add a comment explaining why SocketIO is needed
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 15 Sep 2010 08:39:25 +0000 |
| parents | 534853ba8cd3 |
| children | 9affb4d6e97e |
line wrap: on
line diff
--- a/Lib/socket.py Wed Sep 15 00:09:26 2010 +0000 +++ b/Lib/socket.py Wed Sep 15 08:39:25 2010 +0000 @@ -228,6 +228,13 @@ the raw I/O interface on top of a socket object. """ + # One might wonder why not let FileIO do the job instead. There are two + # main reasons why FileIO is not adapted: + # - it wouldn't work under Windows (where you can't used read() and + # write() on a socket handle) + # - it wouldn't work with socket timeouts (FileIO would ignore the + # timeout and consider the socket non-blocking) + # XXX More docs def __init__(self, sock, mode):
