split: deprecate keep
option in favor of filtering
#20628
Labels
collections
Data structures holding multiple items, e.g. sets
design
Design of APIs or of the language itself
strings
"Strings!"
Milestone
The
keep
option tosplit
, in addition to being somewhat unfortunately named (probably my doing if we excavate), is kind of strange since we can accomplish the same thing by writingfilter(!isempty, split(str, splitter))
. If we had a generator version ofsplit
then this could even be just as efficient assplit(str, splitter, keep=false)
.Related: #20625
The text was updated successfully, but these errors were encountered: