string concatenation
Reinhold Birkenfeld
reinhold-birkenfeld-nospam at wolke7.net
Mon Jun 28 06:46:33 EDT 2004
Peter Otten wrote:
> Reinhold Birkenfeld wrote:
>
>> Maybe I'm not a real man, but the solution I like most (for code that
>
> Of course not, because real men never show doubt :-)
> (If hard pressed, I'll admit I'm no more "real" than you in that respect)
>
>> extensively concatenates strings in this way) is
>>
>> join = lambda x: "".join(x)
>
> Vicious lambda - tricks you into believing that you need it.
Yes, you're right. How could I...
>>>> join = " ".join
>>>> join(["all", "of", "us"])
> 'all of us'
>>>>
>
> Now that's an idiom we both like, I suppose.
Affirmative.
Reinhold
--
Wenn eine Linuxdistribution so wenig brauchbare Software wie Windows
mitbrächte, wäre das bedauerlich. Was bei Windows der Umfang eines
"kompletten Betriebssystems" ist, nennt man bei Linux eine Rescuedisk.
-- David Kastrup in de.comp.os.unix.linux.misc
More information about the Python-list
mailing list