def pickleMethod(method):
 if _PY3:
  return (unpickleMethod, (method.__name__, method.__self__, method.__self__.__class__))
 else:
  return (unpickleMethod, (method.im_func.__name__, method.im_self, method.im_class))

def pickleMethod ( method ) : if _PY3 : return ( unpickleMethod , ( method . __name__ , method . __self__ , method . __self__ . __class__ ) ) else : return ( unpickleMethod , ( method . im_func . __name__ , method . im_self , method . im_class ) )
support function for copy_reg to pickle method refs .