<human>:  Partitioning a string in Python by a regular expression
<bot>: Here is some code to split a string into a list of words and whitespace

re.split('(\\W+)', s)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.