Iterator addition
Paul Rubin
http
Wed Nov 9 23:34:49 EST 2005
More information about the Python-list mailing list
Wed Nov 9 23:34:49 EST 2005
- Previous message (by thread): [ x for x in xrange(10) when p(x) ]
- Next message (by thread): Iterator addition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is there a good reason to not define iter1+iter2 to be the same as itertools.chain(iter1, iter2)? Examples: # all lines in a collection of files, like perl <> all_lines = file1 + file2 + file3 candidate_primes = (2,) + (1+2*i for i in itertools.count(1)) # candidate_primes is 2,3,5,7,9,11,... primes = itertools.ifilter(is_prime, candidate_primes)
- Previous message (by thread): [ x for x in xrange(10) when p(x) ]
- Next message (by thread): Iterator addition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list