split() and string.whitespace

Chaim Krause chaim at chaim.com
Fri Oct 31 15:21:27 EDT 2008


On Oct 31, 2:12 pm, Chaim Krause <ch... at chaim.com> wrote:
> The documentation I am referencing states...
>
> The sep argument may consist of multiple characters (for example, "'1,
> 2, 3'.split(', ')" returns "['1', '2', '3']").
>
> So why doesn't the latter two split on *any* whitespace character, and
> is instead looking for the sep string as a whole?

Now, rereading the documentation in light of the replies to my
origional posting, I see that I misinterpreted the example as using
"comma OR space" when it was actually "commaspace". I am now properly
enlightened.

Thank you all for your help.



More information about the Python-list mailing list