Archive for June, 2005

Using generators to hide loop initialization

Wednesday, June 29th, 2005

How often have you wanted to do a number of things in a loop, but had to move items out of the loop for performance reasons? Here’s a cool use of generators that I just figured out to hide the initialization.

I was trying to use PyICU to get the locale-sensitive hour for the Chandler calendar. […]