TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python Patterns - An Optimization Anecdote

5 点作者 kefeizhou超过 14 年前

2 条评论

onedognight超过 14 年前
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.
arantius超过 14 年前
Previously: <a href="http://news.ycombinator.com/item?id=1859417" rel="nofollow">http://news.ycombinator.com/item?id=1859417</a>