Exemplo n.º 1
0
// IsTrue returns true if the value of obj is considered to be True.  This is
// equivalent to "if obj:" in Python.
func (obj *Base) IsTrue() bool {
	ret := C.PyObject_IsTrue(obj.c())
	if ret < 0 {
		panic(exception())
	}
	return ret != 0
}
Exemplo n.º 2
0
// IsTrue returns true if the value of obj is considered to be True.  This is
// equivalent to "if obj:" in Python.
func (obj *AbstractObject) IsTrue() bool {
	ret := C.PyObject_IsTrue(c(obj))
	if ret < 0 {
		panic(exception())
	}
	return ret != 0
}
Exemplo n.º 3
0
// int PyObject_IsTrue(PyObject *o)
// Returns 1 if the object o is considered to be true, and 0 otherwise. This is equivalent to the Python expression not not o. On failure, return -1.
func (self *PyObject) IsTrue() bool {
	return int2bool(C.PyObject_IsTrue(topy(self)))
}