[Python-Dev] _socket efficiencies ideas

Guido van Rossum guido@python.org
Wed, 09 Apr 2003 10:41:37 -0400

> Ick ick. This is putting a bunch of code for a stub resolver into python.
> This stuff is hard to get right - I implemented this on top of pydns, and
> it was a lot of work to get (what I think is) correct, for not very much
> gain.

What I said.

> The idea of either suppressing DNS lookups for all-numeric addresses, or
> some sort of extended API for suppressing DNS lookups might be better,
> but really, isn't this the job of the stub resolver?

Hey, I just figured it out.  The old socket module (Python 2.1 and
before) *did* special-case \d+\.\d+\.\d+\.\d+!  This code was somehow
lost when the IPv6 support was added.  I propose to put it back in, at
least for IPv4 (AF_INET).  Patch anyone?

--Guido van Rossum (home page: http://www.python.org/~guido/)