Exemple #1
0
func (s *String) Format(args *Tuple) (*String, error) {
	ret := C.PyString_Format(c(s), c(args))
	if ret == nil {
		return nil, exception()
	}
	return newString(ret), nil
}
Exemple #2
0
// PyObject* PyString_Format(PyObject *format, PyObject *args)
// Return value: New reference.
// Return a new string object from format and args. Analogous to format % args. The args argument must be a tuple.
func PyString_Format(format, args *PyObject) *PyObject {
	py_format := topy(format)
	py_args := topy(args)
	return togo(C.PyString_Format(py_format, py_args))
}