def bind_method(cls, name, func):
 if (not PY3):
  setattr(cls, name, types.MethodType(func, None, cls))
 else:
  setattr(cls, name, func)

def bind_method ( cls , name , func ) : if ( not PY3 ) : setattr ( cls , name , types . MethodType ( func , None , cls ) ) else : setattr ( cls , name , func )
bind a method to class parameters cls : type class to receive bound method name : basestring name of method on class instance func : function function to be bound as method returns none .