Class Python Tutorial

class Callback:
    def __init__(self, color):            
        self.color = color
    def __call__(self):                   
        print 'turn', self.color
cb1 = Callback('blue')                    
cb2 = Callback('green')
cb1(  )                                   
cb2(  )                                   
cb3 = (lambda color='red': 'turn ' + color) 
print cb3(  )