Skip to content

Comment on Python Patterns - An Optimization Anecdote

Comments

Oddly the author finally comes up with

    import string
    def f6(list):
        return string.joinfields(map(chr, list), "")
and never the obvious and shorter use of "".join()
    def f8(list):
       return "".join(map(chr, list))
which beats all but the array module in my benchmarks.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.