I come to praise .join, not to bury it...
sholden at holdenweb.com
Mon Mar 5 17:28:57 CET 2001
"Delaney, Timothy" <tdelaney at avaya.com> wrote in message
news:mailman.983756766.27347.python-list at python.org...
> > I have not heard ANY _technical_ arguments opposed to
> > this last time the discussion went around -- nothing but
> > vague aesthetic, "it should be the other way", "I find it
> > ugly" kind of complaints. Unless and until further notice,
> > then, I class these together with the complaints of people
> > who dislike 0-based indexing, on similar vague bases -- as
> > 0-based indexing _works_ better than 1-based, then, for
> > me, it is a superior choice. Aesthetics is in the eye of the
> I truly have no complaints with the technical merits of ''.join().
> However, I have *severe* complaints with the aesthetics and consistency.
> Quite simply, the way we look at things tends to be
> "result" = "thing to be acted on to get the result" modified by "thing
> does the action"
> This is consistently followed in the standard python libraries in almost
> cases ... but ''.join() is a glaring inconsistency. As a result, it seems
> unintuitive and ugly.
> This is why I prefer string.join(sequence, string). It is now syntactic
> sugar for the above, and documented as such. However, it is *important*
> syntactic sugar. It is known that the method is called polymorphically on
> the second argument (a standard interface) but it feels that it is the
> argument which is the basis for the expression. This remains consistent
> the rest of the standard libraries.
> OTOH, I suggest an alternative syntax ...
> There. Everyone should be happy with that ;)
See the FAQ: I have added question 4.96. "Why is join() a string method when
I'm really joining the elements of a (list, tuple, sequence)?" which )for
some value of "summarises") summarises the discussions on this one. Please
feel free to shoot it down in flames. Just trying to keep the bandwidth
done-my-good-deed-for-the-day-ly y'rs - steve
PS: Have a good time at the conference while I'm teaching Unix security in
More information about the Python-list