Charles-François Natali added the comment: > For Windows >= Vista, inet_pton() is available. > I'm not sure whether XP has one of them: if not, then we might keep > the hand-parsing as a fallback.
Apparently, XP doesn't have inet_aton()... So I changed the code to use inet_pton() if available, otherwise use inet_addr(), which is available everywhere (the only gotcha is that it doesn't handle "255.255.255.255", so we special-case it like "<broadcast>"). We thus get rid of the hand-parsing completely, and get a more efficient handling of numeric IPv4 addresses, and a much more efficient handling for numeric IPv6 addresses (see above benchmarks). ---------- keywords: +needs review stage: -> patch review Added file: http://bugs.python.org/file31507/parse_inet.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16201> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com