TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python Patterns - An Optimization Anecdote

5 pointsby kefeizhouover 14 years ago

2 comments

onedognightover 14 years ago
Oddly the author <i>finally</i> comes up with<p><pre><code> import string def f6(list): return string.joinfields(map(chr, list), "") </code></pre> and never the obvious and shorter use of "".join()<p><pre><code> def f8(list): return "".join(map(chr, list)) </code></pre> which beats all but the array module in my benchmarks.
arantiusover 14 years ago
Previously: <a href="http://news.ycombinator.com/item?id=1859417" rel="nofollow">http://news.ycombinator.com/item?id=1859417</a>