summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-15 08:39:25 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-15 08:39:25 (GMT)
commit872b79d02f97d7560d8a0c57d3665cdbefb98f5a (patch)
treeeb31f7e80402f472c1e86b6ad2f80259ec4f1dfa /Lib/socket.py
parentf77c1d6adbdd02b84e7f8431b4c7088563a7a838 (diff)
downloadcpython-872b79d02f97d7560d8a0c57d3665cdbefb98f5a.zip
cpython-872b79d02f97d7560d8a0c57d3665cdbefb98f5a.tar.gz
cpython-872b79d02f97d7560d8a0c57d3665cdbefb98f5a.tar.bz2
Add a comment explaining why SocketIO is needed
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 9b5b23d..2861e0d 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -228,6 +228,13 @@ class SocketIO(io.RawIOBase):
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):