strip weirds

Michael Hudson mwh21 at cam.ac.uk
Thu Dec 14 10:06:29 EST 2000


Robin Becker <robin at jessikat.fsnet.co.uk> writes:

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

Because:

> with the default whitespace arg [...] a run of whitespace is
> [...] treated as a single character.

This is usually what I want, at least, eg:

>>> 'a bunch of  words.  and stuff'.split()
['a', 'bunch', 'of', 'words.', 'and', 'stuff']

This has always been true as far as I know.

Cheers,
M.

-- 
  In short, just business as usual in the wacky world of floating
  point <wink>.                        -- Tim Peters, comp.lang.python



More information about the Python-list mailing list