[Python-checkins] peps: Clarify weasel-words for getaddrinfo().

guido.van.rossum python-checkins at python.org
Tue Apr 30 19:38:14 CEST 2013


http://hg.python.org/peps/rev/a5e25c95fba4
changeset:   4868:a5e25c95fba4
user:        Guido van Rossum <guido at python.org>
date:        Tue Apr 30 10:38:12 2013 -0700
summary:
  Clarify weasel-words for getaddrinfo().

files:
  pep-3156.txt |  15 ++++++++++-----
  1 files changed, 10 insertions(+), 5 deletions(-)


diff --git a/pep-3156.txt b/pep-3156.txt
--- a/pep-3156.txt
+++ b/pep-3156.txt
@@ -430,12 +430,17 @@
   implement their own DNS lookup.  The optional arguments *must* be
   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
-  port names, or they may ignore or incompletely implement the type,
-  proto and flags arguments.  However, if ``type`` and ``proto`` are
-  ignored, the argument values should be reflected unchanged in the
-  return tuples' ``socket_type`` and ``socket_protocol`` elements.
+  port names, or they may ignore or incompletely implement the
+  ``type``, ``proto`` and ``flags`` arguments.  However, if ``type``
+  and ``proto`` are ignored, the argument values passed in should be
+  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
   ``socket.getnameinfo()`` but returns a Future.  The Future's result

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list