strip weirds

Michael Hudson mwh21 at
Thu Dec 14 16:06:29 CET 2000

Robin Becker <robin at> writes:

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


> 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.


  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