Python\'s string.whitespace is great:
>>> string.whitespace \'\\t\\n\\x0b\\x0c\\r \'
How do I use this with a string without resor
There is a special-case shortcut for exactly this use case!
If you call str.split without an argument, it splits on runs of whitespace instead of single characters. So:
str.split
>>> ' '.join("Please \n don't \t hurt \x0b me.".split()) "Please don't hurt me."