[docs] Documentation error in function getaddrinfo in socket module
Berker Peksağ
berker.peksag at gmail.com
Mon Jun 30 10:32:08 CEST 2014
On Tue, Mar 12, 2013 at 10:13 PM, Krishna Kumar Thakur
<krishnak.thakur at yahoo.com> wrote:
>
> Hi,
>
> python version : 3.3.0
>
> Description : getaddrinfo() function expecting 'type' as the keyword
> argument but
> the function documentation says 'socktype' .
>
> please see the below output
>>>> help(getaddrinfo)
> Help on built-in function getaddrinfo in module _socket:
>
> getaddrinfo(...)
> getaddrinfo(host, port [, family, socktype, proto, flags])
> -> list of (family, socktype, proto, canonname, sockaddr)
>
>>>> getaddrinfo.__doc__
> 'getaddrinfo(host, port [, family, socktype, proto, flags])\n -> list of
> (family, socktype, proto, canonname, sockaddr)\n\nResolve host and port into
> addrinfo struct.'
>
> so if the function is called
>>>> i = getaddrinfo('www.python.org','http',socktype = SOCK_STREAM)
> Traceback (most recent call last):
> File "<pyshell#20>", line 1, in <module>
> i = getaddrinfo('www.python.org','http',socktype = SOCK_STREAM)
> TypeError: 'socktype' is an invalid keyword argument for this function
>
> then I have found the correct keyword argument as 'type' in python 3.3
> official documentation.
> Its not the major issue but sometimes it confuses.
>
> As I appreciate python, so I felt its my duty to help make this language
> error free
> as much as possible. :)
Hi,
Fixed. Thanks for the report!
--Berker
>
> ________________________________
> Thank You
>
> Krishna Kumar Thakur
> Contact: +91-7411251885
> E_mail: krishnak.thakur at yahoo.com
>
>
>
> _______________________________________________
> docs mailing list
> docs at python.org
> http://mail.python.org/mailman/listinfo/docs
>
More information about the docs
mailing list