Python 1.6 alpha 1 released

Paul Boddie paulb at infercor.no
Tue Apr 4 04:37:45 EDT 2000


Tres Seaver wrote:
> 

[Single argument 'connect' and the standard libraries]

> This is *not* the same case as the list.append() one, where the
> published interface was itself consistent -- I was quite surprised to
> learn just this spring that multi-argument append was even possible.

Same here.

> But the socket module is one of the first I learned in Python, and I
> have consistenly used the two-argument connect.  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.

Yes, without defining the type of the argument there and then, the reader is
going to start looking around for some kind of hint, and what do they find? And
I can hardly see any positive aesthetic in the use of a tuple as an argument
when "normal" arguments would be more "Pythonic" - they would at least allow you
to write this:

  s.connect(address="123.45.678.9", port=1234)

Although I hear that some code uses a tuple for 'address'... ;-)

> Rough-consensus-and-running-code-wins-every-time'ly

Indeed.

Paul



More information about the Python-list mailing list