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 }
// 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)) }
func NewFloatFromString(s string) *Float { cs := NewString(s) return newFloat(C.PyFloat_FromString((*C.PyObject)(unsafe.Pointer(cs.Obj())), nil)) }