You probably want `for name, w_const in self.constants_w.iteritems()`.