Mark Lawrence <breamore...@yahoo.co.uk>: > One thing I have come to rely on over the years is never, ever trust > your gut instincts about Python performance, you're almost inevitably > wrong. When I first came across the Norvig solver I made a change, > purely for fun, to replace two calls to len() with a single call and > save the result. The run time to solve each puzzle dropped by around > 5%. I believe this meets your "conceptually insignificant".
Yes. It's kinda sad when you have to resort to such low-brow optimizations. Mostly you don't have to, though. You mainly want to keep the expression elegant. Marko -- https://mail.python.org/mailman/listinfo/python-list