Re:C++ has become a scripting language
by benhoyt on Wednesday October 16, 2013 @07:29PM
(#6562727)
Not bad, however with the ''.join(data) you're effectively doubling the amount of memory needed for large files, because it will build the entire output string in memory (and you've already got the list in memory). Better to use writelines(). You can also use sorted() to iterate over and sort the input lines automatically:
[ Parent
| on HN ]
There are no comments on this comment yet.