where is str.itersplit() ?

Konstantin Veretennicov kveretennicov at yahoo.com
Tue May 11 07:00:28 EDT 2004


Don't you think an iterator version of str.split() could be handy
in some cases?
You may have to split() quite a long string, but really need only
one chunk at a time, not entire list at once (looks like a typical
use case for iterator/generator).

I am well aware of re.finditer(), but that means pulling out regex
bigguns, which may be undesirable.

Has there been any discussion of this topic that i missed?
Do you think introduction of string methods isplit()
and isplitlines() would be worth it? With v2.3 itertools and
v2.4 generator expressions the "lazy" trend is obvious.

- kv



More information about the Python-list mailing list