diff options
Diffstat (limited to 'Objects/clinic/floatobject.c.h')
-rw-r--r-- | Objects/clinic/floatobject.c.h | 69 |
1 files changed, 1 insertions, 68 deletions
diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 2c638a2..f53018c 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -290,73 +290,6 @@ exit: return return_value; } -PyDoc_STRVAR(float___setformat____doc__, -"__setformat__($type, typestr, fmt, /)\n" -"--\n" -"\n" -"You probably don\'t want to use this function.\n" -"\n" -" typestr\n" -" Must be \'double\' or \'float\'.\n" -" fmt\n" -" Must be one of \'unknown\', \'IEEE, big-endian\' or \'IEEE, little-endian\',\n" -" and in addition can only be one of the latter two if it appears to\n" -" match the underlying C reality.\n" -"\n" -"It exists mainly to be used in Python\'s test suite.\n" -"\n" -"Override the automatic determination of C-level floating point type.\n" -"This affects how floats are converted to and from binary strings."); - -#define FLOAT___SETFORMAT___METHODDEF \ - {"__setformat__", (PyCFunction)(void(*)(void))float___setformat__, METH_FASTCALL|METH_CLASS, float___setformat____doc__}, - -static PyObject * -float___setformat___impl(PyTypeObject *type, const char *typestr, - const char *fmt); - -static PyObject * -float___setformat__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - const char *typestr; - const char *fmt; - - if (!_PyArg_CheckPositional("__setformat__", nargs, 2, 2)) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("__setformat__", "argument 1", "str", args[0]); - goto exit; - } - Py_ssize_t typestr_length; - typestr = PyUnicode_AsUTF8AndSize(args[0], &typestr_length); - if (typestr == NULL) { - goto exit; - } - if (strlen(typestr) != (size_t)typestr_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("__setformat__", "argument 2", "str", args[1]); - goto exit; - } - Py_ssize_t fmt_length; - fmt = PyUnicode_AsUTF8AndSize(args[1], &fmt_length); - if (fmt == NULL) { - goto exit; - } - if (strlen(fmt) != (size_t)fmt_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - return_value = float___setformat___impl(type, typestr, fmt); - -exit: - return return_value; -} - PyDoc_STRVAR(float___format____doc__, "__format__($self, format_spec, /)\n" "--\n" @@ -388,4 +321,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=3fb0c0624cc87dff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=604cb27bf751ea16 input=a9049054013a1b77]*/ |