[Python-checkins] r84825 - python/branches/py3k/Lib/socket.py

antoine.pitrou python-checkins at python.org
Wed Sep 15 10:39:25 CEST 2010


Author: antoine.pitrou
Date: Wed Sep 15 10:39:25 2010
New Revision: 84825
Log:
Add a comment explaining why SocketIO is needed
Modified:
 python/branches/py3k/Lib/socket.py
Modified: python/branches/py3k/Lib/socket.py
==============================================================================
--- python/branches/py3k/Lib/socket.py	(original)
+++ python/branches/py3k/Lib/socket.py	Wed Sep 15 10:39:25 2010
@@ -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):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /