Difficulty with maxsplit default value for str.split
steve at REMOVEME.cybersource.com.au
Mon Sep 25 10:31:18 CEST 2006
On Sun, 24 Sep 2006 10:34:31 +0200, Fredrik Lundh wrote:
>> But the split method doesn't accept a value of None for maxsplit, and I
>> don't know what default value I should be using.
> def mysplit(S, *args):
> result = S.split(*args)
> return result
Thanks Fredrik, that's *exactly* the sort of insight I was lacking. And
now that you've shown me, I can't believe how obvious it is.
More information about the Python-list