Gerald Britton wrote: > I wonder if this is a bug? Nope, it's part of the defined behaviour. Avoiding the overhead of the GE machinery is actually the main advantage in using a comprehension over the equivalent generator expression. Deliberately raising StopIteration is about the only way to notice the small semantics difference (in Py3k anyway - in 2.x there are scoping differences as well).
Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ 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