Jeff Epler wrote: > I think the current version documentation intends to explain the > no-argument form with this sentence: > If sep is not specified or None, any whitespace string is a separator. > [http://python.org/doc/current/lib/string-methods.html#l2h-197] I'm having a hard time making this clear. By reading the documentation I would guess that "split()" would be equivalent to "split(string.whitespace)". In fact they work very differently. With no separator argument, the separators are grouped. The problem comes when your splitted string has multiple separators next to each other. To make them work the same is more like this mystr.split() filter(None, mystr.split(string.whitespace))
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4