[Python-Dev] I vote to reject: Adding timeout to socket.pyand httplib.py.

Guido van Rossum guido at python.org
Wed Mar 21 18:09:54 CET 2007

On 3/21/07, Terry Reedy <tjreedy at udel.edu> wrote:
> "Josiah Carlson" <jcarlson at uci.edu> wrote in message
> news:20070321081901.FC86.JCARLSON at uci.edu...
> >Alan is off his rocker.
> To me, this sort of ad hominen comment is anti-productive and out-of-place
> in technical discussion.
> "Facundo Batista" <facundo at taniquetil.com.ar> wrote in message
> news:etrcse$ib2$1 at sea.gmane.org...
> >It's better than yours.
> This is a technical claim that can be debated.
> >  Talk is cheap.
> Though slightly indirect, this strikes me (as well as the target) as an ad
> hominen slap that detracts from the technical argument in the rest of the
> post.  See comment above.  I do my best to restrain and censor such add-on
> comments and recommend the same to others, for both personal and public
> benefit.
> Terry Jan Reedy

Tempers flare. Alan's first message (in this thread anyway) wasn't a
shining sample of diplomacy either, and it appeared to be based in a
lack of understanding of the origin of the patch. Let's forget about
that and go back to the patch.

My only issue at this point is that it tries to distinguish carefully
between timeout=None and timeout omitted. As a result the API is
somewhat clumsy: a **kwds that is used for only one keyword, and a
special object instance used as a default. Is that really worth it? I
would personally be totally okay with timeout=None being interpreted
as "use the default timeout, if one has been set". Since the default
timeout is intended for use only as a "big hammer" to temporarily fix
code that doesn't set timeouts but needs it and has no API to pass one
(like httplib before the patch), I am personally in favor of going
back to defaulting timeout to None and skipping the settimeout() call
in _create_connection() if timeout is None. IMO the use case where
there is a global timeout set and one library wants to override it
with "no timeout" is pretty theoretical, and can just as well be
handled by passing sys.maxint as the timeout.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list