On Tuesday 15 September 2009 14:50:11 Xavier Ho wrote: > On Tue, Sep 15, 2009 at 10:31 PM, Ulrich Eckhardt > > <eckha...@satorlaser.com>wrote: > > "'abc'.split('')" gives me a "ValueError: empty separator". > > However, "''.join(['a', 'b', 'c'])" gives me "'abc'". > > > > Why this asymmetry? I was under the impression that the two would be > > complementary. > > I'm not sure about asymmetry, but how would you implement a split method > with an empty delimiter to begin with? It doesn't make much sense anyway.
I fell into this trap some time ago too. There is no such string method. The opposite of "".join(aListOfChars) is list(aString) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list