Ejemplo n.º 1
0
func NewFloatString(v string) (*Float, error) {
	s, err := NewString(v)
	if err != nil {
		return nil, err
	}
	defer s.Decref()
	ret := C.PyFloat_FromString(c(s), nil)
	if ret == nil {
		return nil, exception()
	}
	return newFloat(ret), nil
}
Ejemplo n.º 2
0
// PyObject* PyFloat_FromString(PyObject *str, char **pend)
// Return value: New reference.
// Create a PyFloatObject object based on the string value in str, or NULL on failure. The pend argument is ignored. It remains only for backward compatibility.
func PyFloat_FromString(str *PyObject) *PyObject {
	return togo(C.PyFloat_FromString(topy(str), nil))
}
Ejemplo n.º 3
0
func NewFloatFromString(s string) *Float {
	cs := NewString(s)
	return newFloat(C.PyFloat_FromString((*C.PyObject)(unsafe.Pointer(cs.Obj())), nil))
}