예제 #1
0
파일: object.go 프로젝트: MogeiWang/py
// Not returns true if the value of obj is considered to be False.  This is
// equivalent to "if not obj:" in Python.
func (obj *Base) Not() bool {
	ret := C.PyObject_Not(obj.c())
	if ret < 0 {
		panic(exception())
	}
	return ret != 0
}
예제 #2
0
파일: abstract.go 프로젝트: gbbr/textmate
// Not returns true if the value of obj is considered to be False.  This is
// equivalent to "if not obj:" in Python.
func (obj *AbstractObject) Not() bool {
	ret := C.PyObject_Not(c(obj))
	if ret < 0 {
		panic(exception())
	}
	return ret != 0
}
예제 #3
0
파일: object.go 프로젝트: gward/go-python
// int PyObject_Not(PyObject *o)
// Returns 0 if the object o is considered to be true, and 1 otherwise. This is equivalent to the Python expression not o. On failure, return -1.
func (self *PyObject) Not() bool {
	return int2bool(C.PyObject_Not(topy(self)))
}