[Python-Dev] Adding timeout to socket.py and httplib.py
Facundo Batista
facundo at taniquetil.com.ar
Tue Mar 20 21:41:05 CET 2007
Josiah Carlson wrote:
> sentinel = object()
>
> def connect(HOST, PORT, timeout=sentinel):
> ...
> if timeout is not sentinel:
> sock.settimeout(timeout)
> ...
>
> A keyword argument via **kwargs is also fine. I have no preference.
I do. The way you showed here, I'm not restricting user options. I think
this is better.
Regards,
--
. Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-Dev
mailing list