Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Heads up: socket.connect() breakage ahead

Guido van Rossumguido@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 ofseparate x and y arguments.  There are good reasons for passing it asa 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 bedocumented.  The problem is that I can't document it as connect(host,port) -- there are Unix domain sockets that only take a single stringargument (a filename).  Also, sendto() takes a (host, port) tupleonly.  It has other arguments so that's the only form.Maybe I'll have to document it as connect(address) with a backwardscompatible 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/)


[8]ページ先頭

©2009-2025 Movatter.jp