
On Sun, 31 Jul 2011 09:26:33 +0800 Senthil Kumaran <senthil@uthcode.com> wrote:
I found that [, timeout] bit odd too. But is not mentioning that as timeout=None when it is timeout=socket._GLOBAL_DEFAULT_TIME technically inaccurate?
FWIW, I see similar style (...,[,timeout], kw=val) adopted elsewhere in the library docs too. urllib, httplib, nntplib etc. Though it does not look okay, it is better than giving inaccurate information.
Indeed, we don't want to document the private sentinel object.
While ftplib and poplib, has them as timeout=None, while they default to socket._GLOBAL_DEFAULT_TIMEOUT object.
This is wrong; someone may pass None thinking it will trigger the default behaviour, and have nasty surprises.
3. def somesocketmethod(arg1,arg2[,timeout], kwarg=value)
However weird-looking, I think this is the correct solution here. Regards Antoine.