On 23 November 2017 at 12:42, Ivan Levkivskyi <levkivs...@gmail.com> wrote: >> See e.g. http://www.tornadoweb.org/en/stable/gen.html >> > > Great, so I open this page and see this code: > > results = [] > for future in list_of_futures: > results.append(yield future) > > Interesting, why don't they use a comprehension for this and instead need to > invent a whole `tornado.gen.multi` function?
Because yield expressions in comprehensions are difficult to understand, and the loop form is easy to understand? :-) (Certainly I didn't find the explanation in that page confusing, I don't know if I'd have found a comprehension form confusing, but I suspect I might have...) Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com