summaryrefslogtreecommitdiffstats
path: root/Objects/clinic
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 02:05:25 (GMT)
committerGitHub <noreply@github.com>2022-02-25 02:05:25 (GMT)
commit7d03c8be5af2f1559dbc35b775b3116dfd63cfb6 (patch)
treeee3ab35b838f7460e90a3330fc0a97eb12adacda /Objects/clinic
parent1b2611eb0283055835e5df632a7a735db8c894b8 (diff)
downloadcpython-7d03c8be5af2f1559dbc35b775b3116dfd63cfb6.zip
cpython-7d03c8be5af2f1559dbc35b775b3116dfd63cfb6.tar.gz
cpython-7d03c8be5af2f1559dbc35b775b3116dfd63cfb6.tar.bz2
bpo-46852: Rename float.__set_format__() to float.__setformat__() (GH-31558)
Rename the private undocumented float.__set_format__() method to float.__setformat__() to fix a typo introduced in Python 3.7. The method is only used by test_float. The change enables again test_float tests on the float format which were previously skipped because of the typo. The typo was introduced in Python 3.7 by bpo-20185 in commit b5c51d3dd95bbfde533655fb86ac0f96f771ba7b.
Diffstat (limited to 'Objects/clinic')
-rw-r--r--Objects/clinic/floatobject.c.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h
index 88dc482..2c638a2 100644
--- a/Objects/clinic/floatobject.c.h
+++ b/Objects/clinic/floatobject.c.h
@@ -290,8 +290,8 @@ exit:
return return_value;
}
-PyDoc_STRVAR(float___set_format____doc__,
-"__set_format__($type, typestr, fmt, /)\n"
+PyDoc_STRVAR(float___setformat____doc__,
+"__setformat__($type, typestr, fmt, /)\n"
"--\n"
"\n"
"You probably don\'t want to use this function.\n"
@@ -308,25 +308,25 @@ PyDoc_STRVAR(float___set_format____doc__,
"Override the automatic determination of C-level floating point type.\n"
"This affects how floats are converted to and from binary strings.");
-#define FLOAT___SET_FORMAT___METHODDEF \
- {"__set_format__", (PyCFunction)(void(*)(void))float___set_format__, METH_FASTCALL|METH_CLASS, float___set_format____doc__},
+#define FLOAT___SETFORMAT___METHODDEF \
+ {"__setformat__", (PyCFunction)(void(*)(void))float___setformat__, METH_FASTCALL|METH_CLASS, float___setformat____doc__},
static PyObject *
-float___set_format___impl(PyTypeObject *type, const char *typestr,
- const char *fmt);
+float___setformat___impl(PyTypeObject *type, const char *typestr,
+ const char *fmt);
static PyObject *
-float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs)
+float___setformat__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
const char *typestr;
const char *fmt;
- if (!_PyArg_CheckPositional("__set_format__", nargs, 2, 2)) {
+ if (!_PyArg_CheckPositional("__setformat__", nargs, 2, 2)) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("__set_format__", "argument 1", "str", args[0]);
+ _PyArg_BadArgument("__setformat__", "argument 1", "str", args[0]);
goto exit;
}
Py_ssize_t typestr_length;
@@ -339,7 +339,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs
goto exit;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("__set_format__", "argument 2", "str", args[1]);
+ _PyArg_BadArgument("__setformat__", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t fmt_length;
@@ -351,7 +351,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
- return_value = float___set_format___impl(type, typestr, fmt);
+ return_value = float___setformat___impl(type, typestr, fmt);
exit:
return return_value;
@@ -388,4 +388,4 @@ float___format__(PyObject *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=122a73f4c9d25806 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3fb0c0624cc87dff input=a9049054013a1b77]*/