Message335285
After iterating over this over the last few days I realized it makes more sense to implement and discuss the whole thing in here and as a single PR, so sorry about previously splitting this in a separate ticket/PR. Relevant PR is now this one and is ready for review:
https://github.com/python/cpython/pull/11784
Relevant changes which probably require attention/discussion are:
1) since it was sort of ambiguous I renamed "has_dual_stack()" to "supports_hybrid_ipv46()". There could be space for some bikeshed as we already have "socket.has_ipv6" so this may be "has_hybrid_ipv46()" called instead
2) if family is unspecified and determined from *host* (e.g. "localhost" or "") the function sorts getaddrinfo() results preferring AF_INET over AF_INET6
3) doc includes link to my http://code.activestate.com/recipes/578504 recipe for platforms not supporting hybrid_ipv46 natively
4) it may be worthwhile (or maybe not?) to have another complementary bind_sockets() (plural) function returning all items from getaddrinfo(). That would be useful for non-blocking apps/frameworks and could be reused by asyncio.
Also, I'm CC-ing people from issue20215 as it contains relevant comments. |
|
Date |
User |
Action |
Args |
2019-02-12 04:42:06 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, loewis, gregory.p.smith, jaraco, nirs, pitrou, josiah.carlson, r.david.murray, asvetlov, neologix, berker.peksag, martin.panter, jpokorny, jleedev, dazhaoyu, andreasr, Carlos.Ralli, Paul Marks, cheryl.sabella |
2019-02-12 04:42:06 | giampaolo.rodola | set | messageid: <1549946526.21.0.534589654757.issue17561@roundup.psfhosted.org> |
2019-02-12 04:42:06 | giampaolo.rodola | link | issue17561 messages |
2019-02-12 04:42:06 | giampaolo.rodola | create | |
|