2009/10/23 John Arbash Meinel <john.arbash.mei...@gmail.com>: > I was pretty surprised that it was 30% faster than "for x in s: pass". I > assume it has something to do with a potential "else:" statement?
I'd imagine it's actually because it has to call next() a second time and deal with the StopIteration exception - the loop has to end normally, whereas the break form exits prematurely. Paul. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com