This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sjohn
Recipients sjohn
Date 2009-04-27.12:10:45
SpamBayes Score 1.6213053e-10
Marked as misclassified No
Message-id <1240834247.59.0.00160840317188.issue5855@psf.upfronthosting.co.za>
In-reply-to
Content
To flatten lists of lists, e.g. [[0], [1], [2], ...], I found the short
and quite python-like one-liner "sum(listoflists, [])". This, however,
has absolutely awful performance: while the equivalent way of iterating
by hand and extending a flat list is longer and uglier, it performs fast
and in linear time. The sum() variant takes unacceptably long. I do not
know why this should behave worse-than-linear...
History
Date User Action Args
2009-04-27 12:10:47sjohnsetrecipients: + sjohn
2009-04-27 12:10:47sjohnsetmessageid: <1240834247.59.0.00160840317188.issue5855@psf.upfronthosting.co.za>
2009-04-27 12:10:46sjohnlinkissue5855 messages
2009-04-27 12:10:45sjohncreate