Alan Kennedy wrote:

>  - Explicitly check that the address passed is a tuple of (string, integer)

It's more probable that a use pass a list of two values, that a host of
two letters as you suggested above...


>  - To raise an exception explaining the parameter expectation when it is not 
> met

Won't be necessary if we take into account the explicit timeout
parameter...

>  - To require that the user explicitly name the timeout parameter

I already agreed on this, :)


So, as a resume:

 - I'll make "timeout" mandatory
 - The function signature will be:

    create_connection(address[, timeout])

        See that timeout doesn't have a default value, if you include it, it'll
        set the socket timeout, if you don't, the defaultimeout will work.
        The address is a tuple (host, port), as usual

In the code, I'll just make "host, port = address", I don't think it
will be a problem at all. Remember that this function primary use is for
higher level libraries, and that "address" in socket enviroment is
always, always, (host, port).

Regards,

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


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to