Clarify weasel-words for getaddrinfo().

This commit is contained in:
Guido van Rossum 2013-04-30 10:38:12 -07:00
parent 40dc92be19
commit 801e07188f
1 changed files with 10 additions and 5 deletions

View File

@ -430,12 +430,17 @@ usually called implicitly by ``create_connection()``,
implement their own DNS lookup. The optional arguments *must* be implement their own DNS lookup. The optional arguments *must* be
specified as keyword arguments. specified as keyword arguments.
Note: implementations are required to implement a subset of the full Note: implementations are allowed to implement a subset of the full
socket.getaddrinfo() interface; e.g. they may not support symbolic socket.getaddrinfo() interface; e.g. they may not support symbolic
port names, or they may ignore or incompletely implement the type, port names, or they may ignore or incompletely implement the
proto and flags arguments. However, if ``type`` and ``proto`` are ``type``, ``proto`` and ``flags`` arguments. However, if ``type``
ignored, the argument values should be reflected unchanged in the and ``proto`` are ignored, the argument values passed in should be
return tuples' ``socket_type`` and ``socket_protocol`` elements. copied unchanged into the return tuples' ``socket_type`` and
``socket_protocol`` elements. (You can't ignore ``family``, since
IPv4 and IPv6 addresses must be looked up differently. The only
permissible values for ``family`` are ``socket.AF_UNSPEC`` (``0``),
``socket.AF_INET`` and ``socket.AF_INET6``, and the latter only if
it is defined by the platform.)
- ``getnameinfo(sockaddr, flags=0)``. Similar to - ``getnameinfo(sockaddr, flags=0)``. Similar to
``socket.getnameinfo()`` but returns a Future. The Future's result ``socket.getnameinfo()`` but returns a Future. The Future's result