def autoassign(self, locals):
 for (k, v) in locals.iteritems():
  if (k == 'self'):
   continue
  setattr(self, k, v)

def autoassign ( self , locals ) : for ( k , v ) in locals . iteritems ( ) : if ( k == 'self' ) : continue setattr ( self , k , v )
automatically assigns local variables to self .