[Python-Dev] _socket efficiencies ideas

Skip Montanaro skip@pobox.com
Wed, 9 Apr 2003 13:44:51 -0500


    Martin> It turns out that Python doesn't need to 100% detect numeric
    Martin> addresses, as long as it would not classify addresses as numeric
    Martin> which aren't.  Perhaps it is even possible to leave the "is
    Martin> numeric" test to the implementation of getaddrinfo, i.e. calling
    Martin> it twice (try numeric first, then try resolving the name)?

Can a top-level domain be all digits?  If not, why not assume numeric if
re.search(r"\.\d+$", addr) is not None?

Skip