예제 #1
0
파일: object.go 프로젝트: MogeiWang/py
// Bytes returns a Bytes representation of "obj".  This is equivalent to the
// Python "bytes(obj)".  In Python 2.x this method is identical to Str().
//
// Return value: New Reference.
func (obj *Base) Bytes() (*Base, error) {
	ret := C.PyObject_Bytes(obj.c())
	return obj2ObjErr(ret)
}
예제 #2
0
파일: object.go 프로젝트: gward/go-python
// PyObject* PyObject_Bytes(PyObject *o)
// Compute a bytes representation of object o. In 2.x, this is just a alias for PyObject_Str().
func (self *PyObject) Bytes() *PyObject {
	return togo(C.PyObject_Bytes(self.ptr))
}
예제 #3
0
파일: base.go 프로젝트: xushiwei/gopy
// Bytes returns a Bytes representation of "obj".  This is equivalent to the
// Python "bytes(obj)".  In Python 2.x this method is identical to Str().
//
// Return value: New Reference.
func (obj *BaseObject) Bytes() (Object, error) {
	ret := C.PyObject_Bytes(c(obj))
	return obj2ObjErr(ret)
}