ブックマーク / www.python.org (1)

  • Python Patterns - An Optimization Anecdote

    The other day, a friend asked me a seemingly simple question: what's the best way to convert a list of integers into a string, presuming that the integers are ASCII values. For instance, the list [97, 98, 99] should be converted to the string 'abc'. Let's assume we want to write a function to do this. The first version I came up with was totally straightforward: def f1(list): string = "" for item

    ymiyata3
    ymiyata3 2011/10/16
    Efficient way to convert string to a list of char
  • 1