11.06.13 01:50, Chris Angelico написав(ла):
On Tue, Jun 11, 2013 at 6:34 AM, Roy Smith <r...@panix.com> wrote:new_songs = [s for s in songs if s.is_new()] old_songs = [s for s in songs if not s.is_new()]Hmm. Would this serve? old_songs = songs[:] new_songs = [songs.remove(s) or s for s in songs if s.is_new()]
O(len(songs)**2) complexity. -- http://mail.python.org/mailman/listinfo/python-list