def _unary_method(ufunc, name):

    def func(self):
        return ufunc(self)
    func.__name__ = '__{}__'.format(name)
    return func
def _unary_method(ufunc, name):

    def func(self):
        return ufunc(self)
    func.__name__ = '__{}__'.format(name)
    return func