Andre Alexander Bell <p...@andre-bell.de> wrote: >> I occasionally use LCs, if they seem useful. However, what I >> don't like about LCs is that they 'look-like' being a closed scope >> [...] >
antingrick <rantingr...@gmail.com> wrote: > I must admit you make a good point here however the only time that > will slip you up is when you first experienced the Python LC syntax. > After a few "hello world" LC's you'll begin to love and understand > them completely. I agree. I resisted LCs when they first came out, passing them off as unnecessary, confusing, etc. Eventually, I came to be comfortable with them and use them often. I did not realize just how far my mind-change had gone until just yesterday when I was hacking on some PHP code. I wrote: $values = array(); foreach ($ids as $id) { $values[] = $id; } and found myself asking my office-mate, "Hey, Chris, does PHP have list comprehensions?" I was bummed to discover that it does not. -- http://mail.python.org/mailman/listinfo/python-list