A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-March/072147.html below:

[Python-Dev] Adding timeout to socket.py and httplib.py

[Python-Dev] Adding timeout to socket.py and httplib.pyFacundo Batista facundo at taniquetil.com.ar
Tue Mar 20 20:24:30 CET 2007
Alan Kennedy wrote:

> [Facundo]
>> But, I recognize that maybe it's [connect] not the best name. What about
>> "create_connection"?
>
> I have no strong feelings about it, other than to say it should not be
> "connect". How about

Ok. "create_connection", then.


> Ah, but it's too late by the time the socket.connect call returns: the
> timeout/blocking behaviour of the socket.connect call is the very
> thing we're trying to control.

It's not the very thing, just one of them... whatever, you have a point.


> Whereas with the slightly modified API I suggested earlier, it simply becomes

I'm OK with that API, except that you're losing position
parameters. It's OK to *always* need to put the "timeout="? 

The problem here is that I used None to check if you passed a parameter
or not, an idiom well stablished in Python, but in this very case None
has a meaning for itself.

I'm +0 on having the obligation to a named parameter here. 


So, I have two modifications to make to the patch:

- change the name to "create_connection"
- make timeout obligatory named

Is everybody ok with this?

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4