String.join revisited (URGENT for 1.6)
mwh21 at cam.ac.uk
Tue May 30 13:39:46 CEST 2000
m.faassen at vet.uu.nl (Martijn Faassen) writes:
> Fredrik Lundh <effbot at telia.com> wrote:
> > if you think that keeping string.join in there is the most serious
> > design mistake in 1.6, you may be in for some really interesting
> > surprises...
> That of course doesn't make it any less true that we should stop
> " ".join() *now* before it is too late. If there are other more serious
> design mistakes, I suggest you point them out to us if you want our
> help fixing them. :)
> Since the debate about generalized 'join()' on lists can be fought
> on forever, what about following the earlier more pragmatic
> suggestion of somehow hiding 'join()' on strings and exposing it
> only through string.join(), making that the One Right Way to Do It?
> If 'string' suddenly is a pain to import, a builtin: sjoin() or
> " ".join() is just not making sense to a *lot* of people. I'm sure
> you can get used to it, but I had to blink a couple of hundred times
> first, myself.
Well, to add a counterview, I am quite happy with sep.join; when I
first saw it I thought (once!) "hmm, that's odd", and then got on with
It's not an obvious solution, I'd admit - but that doesn't mean it's
not a good one.
Strangely enough I saw just such a beast at the grocery store
last night. Starbucks sells Javachip. (It's ice cream, but that
shouldn't be an obstacle for the Java marketing people.)
-- Jeremy Hylton, 29 Apr 1997
More information about the Python-list