unintuitive for-loop behavior

Gregory Ewing greg.ewing at canterbury.ac.nz
Sat Oct 1 06:56:45 EDT 2016


Random832 wrote:

 > for a in collection:
 >     b = some_calculation_of(a)
 >     final b: do_something_with(lambda: ... b ...)

I would prefer something like

   for a in collection:
     let b = some_calculation_of(a):
       do_something_with(lambda: ... b ...)

-- 
Greg



More information about the Python-list mailing list