summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_iter.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Generalize map() to work with iterators.Tim Peters2001-05-031-0/+35
| | | | | | | | | | | NEEDS DOC CHANGES. Possibly contentious: The first time s.next() yields StopIteration (for a given map argument s) is the last time map() *tries* s.next(). That is, if other sequence args are longer, s will never again contribute anything but None values to the result, even if trying s.next() again could yield another result. This is the same behavior map() used to have wrt IndexError, so it's the only way to be wholly backward-compatible. I'm not a fan of letting StopIteration mean "try again later" anyway.
* Remove redundant copy+paste code.Tim Peters2001-05-031-3/+0
|
* Generalize max(seq) and min(seq) to work with iterators.Tim Peters2001-05-031-0/+35
| | | | NEEDS DOC CHANGES.
* Generalize filter(f, seq) to work with iterators. This also generalizesTim Peters2001-05-021-0/+44
| | | | | filter() to no longer insist that len(seq) be defined. NEEDS DOC CHANGES.
* Generalize list(seq) to work with iterators. This also generalizes list()Tim Peters2001-05-011-0/+32
| | | | | | | | | | | | | to no longer insist that len(seq) be defined. NEEDS DOC CHANGES. This is meant to be a model for how other functions of this ilk (max, filter, etc) can be generalized similarly. Feel encouraged to grab your favorite and convert it! Note some cute consequences: list(file) == file.readlines() == list(file.xreadlines()) list(dict) == dict.keys() list(dict.iteritems()) = dict.items() list(xrange(i, j, k)) == range(i, j, k)
* Add test suite for iterators.Guido van Rossum2001-04-211-0/+246