コード例 #1
0
ファイル: object.go プロジェクト: MogeiWang/py
// 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
}
コード例 #2
0
ファイル: abstract.go プロジェクト: gbbr/textmate
// 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
}
コード例 #3
0
ファイル: object.go プロジェクト: gward/go-python
// 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)))
}