List comprehension - NameError: name '_[1]' is not defined ?

mario ruggier mario.ruggier at gmail.com
Thu Jan 15 13:58:01 CET 2009


On Jan 15, 1:48 pm, bearophileH... at lycos.com wrote:
> mario ruggier, that's a hack that you can forget. Your code can't be
> read. Don't use list comps for that purpose. Write code that can be
> read.

Ya, agree with you whole-heartily, but then so are most
optimizations ;-) It is just an idea I am exploring, and that code
would be never be humanly written (that's why it seems more convoluted
than necessary). I hope the simplified boiled down sample gets the
intention out better... i'd still would like to understand why the '_
[1]' variable is disappearing after first inner loop!

> Bye,
> bearophile




More information about the Python-list mailing list