Tim Chase <python.l...@tim.thechases.com> writes: > if portion is None: > content = iter(f)
iter(f) will iterate over lines in the file, which doesn't fit with the rest of the algorithm. Creating an iterator that iterates over fixed-size file chunks (in this case of length 1) is where the two-argument form of iter comes in handy: content = iter(lambda: f.read(1), '') -- http://mail.python.org/mailman/listinfo/python-list