Difficulty with maxsplit default value for str.split

Steven D'Aprano steve at REMOVEME.cybersource.com.au
Mon Sep 25 04:31:18 EDT 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):
> 	pre_processing()
> 	result = S.split(*args)
> 	post_processing()
> 	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.


-- 
Steven D'Aprano 




More information about the Python-list mailing list