feature request: a better str.endswith

Michele Simionato mis6 at pitt.edu
Sun Jul 20 11:21:52 EDT 2003


Oops! My mistake, I forgot the islice; it should be

the=lambda pred,seq: list(itertools.islice(itertools.ifilter(pred,seq),0,1))

in such a way that we exit at the first hit, otherwise one could just use
the standard "filter". 

not-yet-good-enough-with-itertools-but-improving-ly your's

          Michele




More information about the Python-list mailing list