MCPcopy Create free account
hub / github.com/goplus/py / String

Method String

object.go:205–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203}
204
205func (obj *Base) String() string {
206 if v, ok := AsString(obj); ok {
207 return v.String()
208 }
209 ret := C.PyObject_Str(obj.c())
210 if ret == nil {
211 return "<nil>"
212 }
213 defer C.decref(ret)
214 return ((*String)(unsafe.Pointer(ret))).String()
215}
216
217// Bytes returns a Bytes representation of "obj". This is equivalent to the
218// Python "bytes(obj)". In Python 2.x this method is identical to Str().

Callers 11

TestCompileFunction · 0.45
_TestEvalLocalGlobalsFunction · 0.45
ToStringFunction · 0.45
ErrorMethod · 0.45
TestModuleFunction · 0.45
TestBaseFunction · 0.45
MapStringMethod · 0.45
TestCallFunction · 0.45
NewExFunction · 0.45
TestFunction · 0.45
checkFooFunction · 0.45

Calls 2

cMethod · 0.95
AsStringFunction · 0.85

Tested by 7

TestCompileFunction · 0.36
_TestEvalLocalGlobalsFunction · 0.36
TestModuleFunction · 0.36
TestBaseFunction · 0.36
TestCallFunction · 0.36
TestFunction · 0.36
checkFooFunction · 0.36