Ville Vainio ville at
Thu Mar 17 07:49:26 CET 2005

>>>>> "Michele" == michele simionato <michele.simionato at> writes:

    Michele> But then why he agreed to have the loop variable
    Michele> disappear outside a generator comprehension?  I think
    Michele> there is something more than a backward compatibility
    Michele> concern.

With normal for-loop (as opposed to genexps and LCs), the "last" value
of the loop variable might be useful outside the loop if the loop was
exited prematurely through 'break' statement or exception.

Ville Vainio

More information about the Python-list mailing list