>>> def test(a): ... def clos(): ... return a ... return clos ... >>> x=test(1) >>> y=test(22) >>> x() 1 >>> y() 22