Exemplo n.º 1
0
// RichCompare compares "obj" with "obj2" using the specified operation (LE, GE
// etc.), and returns the result.  The equivalent Python is "obj op obj2", where
// op is the corresponding Python operator for op.
//
// Return value: New Reference.
func (obj *Base) RichCompare(obj2 *Base, op Op) (*Base, error) {
	ret := C.PyObject_RichCompare(obj.c(), obj2.c(), C.int(op))
	return obj2ObjErr(ret)
}
Exemplo n.º 2
0
// PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid)
// Return value: New reference.
// Compare the values of o1 and o2 using the operation specified by opid, which must be one of Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, or Py_GE, corresponding to <, <=, ==, !=, >, or >= respectively. This is the equivalent of the Python expression o1 op o2, where op is the operator corresponding to opid. Returns the value of the comparison on success, or NULL on failure.
func (self *PyObject) RichCompare(o2 *PyObject, opid Py_OPID) *PyObject {
	return togo(C.PyObject_RichCompare(self.ptr, o2.ptr, C.int(opid)))
}
Exemplo n.º 3
0
// RichCompare compares "obj" with "obj2" using the specified operation (LE, GE
// etc.), and returns the result.  The equivalent Python is "obj op obj2", where
// op is the corresponding Python operator for op.
//
// Return value: New Reference.
func (obj *BaseObject) RichCompare(obj2 Object, op Op) (Object, error) {
	ret := C.PyObject_RichCompare(c(obj), c(obj2), C.int(op))
	return obj2ObjErr(ret)
}