コード例 #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)
}