Martin v. Löwis added the comment:

Charles-François: you get the idna overhead in 2.7, too, by specifying 
u'127.0.0.1' as the address.

The idna overhead could be bypassed fairly easily in C by:
1. checking that the string is an ASCII string (this is possible in constant 
time, in 3.x)
2. directly passing the ASCII string to setipaddr (leaving any error detection 
to this routine)

Before adding caching, I'd check whether a cache lookup is actually faster than 
calling inet_pton.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22127>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to