Пример #1
0
// RichCompare compares "obj" with "obj2" using the specified operation (LE, GE
// etc.), and returns true or false.  The equivalent Python is "obj op obj2",
// where op is the corresponding Python operator for op.
func (obj *Base) RichCompareBool(obj2 *Base, op Op) (bool, error) {
	ret := C.PyObject_RichCompareBool(obj.c(), obj2.c(), C.int(op))
	return int2BoolErr(ret)
}
Пример #2
0
// int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
// 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. Returns -1 on error, 0 if the result is false, 1 otherwise. This is the equivalent of the Python expression o1 op o2, where op is the operator corresponding to opid.
func (self *PyObject) RichCompareBool(o2 *PyObject, opid Py_OPID) int {
	return int(C.PyObject_RichCompareBool(self.ptr, o2.ptr, C.int(opid)))
}
Пример #3
0
// RichCompare compares "obj" with "obj2" using the specified operation (LE, GE
// etc.), and returns true or false.  The equivalent Python is "obj op obj2",
// where op is the corresponding Python operator for op.
func (obj *BaseObject) RichCompareBool(obj2 Object, op Op) (bool, error) {
	ret := C.PyObject_RichCompareBool(c(obj), c(obj2), C.int(op))
	return int2BoolErr(ret)
}