|start | find | index | login or register | edit|
by earl, 4018 days agoGuido van Rossum - An Optimization Anecdote (from somewhen in 2005, presumably): "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'."
A nice case for "no stinking loops". Not to spoil it, but the two fastest version don't explicitly loop but use built-ins to express the desired effects on a collection. In general, this is the case to be made against the oh-so-flexible
17 active users
|earl.strain.at • esa3 • online for 6851 days • c'est un vanilla site|