Christopher Subich wrote: > My naive solution: ... > for i in ilist: > try: > g = i.next() > count += 1 > except StopIteration: # End of iter > g = None ...
What I didn't like about this was the extra overhead of all the StopIteration exceptions. Eg, zipfill("a", range(1000)) will raise 1000 exceptions (999 for "a" and 1 for the end of the range). But without doing timing tests I'm not sure which approach is fastest, and it may depend on the data set. Since this is code best not widely used, I don't think it's something anyone should look into either. :) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list