[Python-Dev] Heads up: socket.connect() breakage ahead
Guido van Rossum
guido@python.org
Tue, 04 Apr 2000 03:03:58 -0400
> I think this one already caused too much pain: it appears virtually
> everyone uses the two-argument form routinely, and the reason for getting
> rid of that seems pretty weak. As Tres Seaver just wrote on c.l.py,
>
> Constructing a spurious "address" object (which has no behavior, and
> exists only to be torn apart inside the implementation) seems a
> foolish consistency, beyond doubt.
No more foolish than passing a point as an (x, y) tuple instead of
separate x and y arguments. There are good reasons for passing it as
a tuple, such as being able to store and recall it as a single entity.
> So offer to back off on this one, in return for making 1/2 yield 0.5 <wink>.
Unfortunately, I think I will have to. And it will have to be
documented. The problem is that I can't document it as connect(host,
port) -- there are Unix domain sockets that only take a single string
argument (a filename). Also, sendto() takes a (host, port) tuple
only. It has other arguments so that's the only form.
Maybe I'll have to document it as connect(address) with a backwards
compatible syntax connect(a, b) being equivalent to connect((a, b)).
At least that sets the record straight without breaking old code.
Still torn,
--Guido van Rossum (home page: http://www.python.org/~guido/)