On Jun 11, 9:08 am, Fábio Santos <fabiosantos...@gmail.com> wrote: > On 10 Jun 2013 23:54, "Roel Schroeven" <r...@roelschroeven.net> wrote: > > new_songs, old_songs = [], [] > > [(new_songs if s.is_new() else old_songs).append(s) for s in songs] > > This is so beautiful!
No, it's actually pretty terrible. It creates a list in order to populate _two other lists_ and then throws away the one made by the comprehension. There's nothing ugly about multiline for-loops. -- http://mail.python.org/mailman/listinfo/python-list