Piet van Oostrum <pie...@pietvanoostrum.com> writes: > It is a poor man's 'let'. It would be nice if python had a real 'let' > construction. Or for example: > > [(tmp, tmp + 1) for x in data with tmp = expensive_calculation(x)] > > Alas!
It would be nice indeed! Or even [(tmp, tmp + 1) for x in data with expensive_calculation(x) as tmp if tmp is not None] that fits the usual "with" syntax. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list