strip weirds

Robin Becker robin at jessikat.fsnet.co.uk
Thu Dec 14 07:43:03 EST 2000


Can somebody explain why strip behaves differently with and without an
argument?

>>> from string import split
>>> split(' ')
[]
>>> split(' ',' ')
['', '']
>>> split('  ')
[]
>>> split('  ',' ')
['', '', '']
>>> 

with the default whitespace arg seems as though a run of whitespace is
being treated as a single character.
-- 
Robin Becker



More information about the Python-list mailing list