New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"string".split behaviour for empty strings #39287
Comments
"".split() -> [] "".split(' ') -> [''] It is not clear from the documentation as to what is From stringobject.c, the behaviour of split_whitespace |
Logged In: YES "".split(None) -> [] which is expected because in the case when no sep is |
Logged In: YES And so it is. The whitespace version (no args) and the This code has been around for a good while and it is likely "One man's bug is another man's feature" |
Logged In: YES Thats so counter intuitive.. :-( At least the documentation should specify the fact that the The reason this probably never came up ( or mostly ignored I am not closing the bug before the specific behaviour of |
Logged In: YES Suggestion: find section of Lib Ref discussing str.split, quote |
Logged In: YES Fixed in doc/lib/libstring.tex version 1.57 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: