I've been doing this: keys =3D self.someclass.keys() for key in keys: ( do something ) What's the shorter way?