We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The docs says split_before
split_before
Yield lists of items from iterable, where each list starts with an item where callable pred returns True
But why below returns
In [3]: list(split_before(range(1, 10), lambda n: n % 3 == 0)) Out[3]: [[1, 2], [3, 4, 5], [6, 7, 8], [9]]
Rather than returns
In [3]: list(split_before(range(1, 10), lambda n: n % 3 == 0)) Out[3]: [[3, 4, 5], [6, 7, 8], [9]]
What i`m got wrong ? Thanks in advance
The text was updated successfully, but these errors were encountered:
Thanks for the note. You're right; I should change the docstring to be more accurate. No items are skipped by split_before.
Sorry, something went wrong.
Thanks for your reply, it solves my question.
I've thought that list(split_before('OneTwo', lambda s: s.isupper())) will return [[''], ['O', 'n', 'e'], ['T', 'w', 'o']]...
list(split_before('OneTwo', lambda s: s.isupper()))
[[''], ['O', 'n', 'e'], ['T', 'w', 'o']]
No branches or pull requests
The docs says
split_before
But why below returns
Rather than returns
What i`m got wrong ? Thanks in advance
The text was updated successfully, but these errors were encountered: