summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 15:13:34 (GMT)
committerGitHub <noreply@github.com>2022-02-25 15:13:34 (GMT)
commita549cd1fc55888e2e287714b25e2cb2251913909 (patch)
treea4aeb15c154d8199485942e8967c6e5b41b59fb0 /Objects/floatobject.c
parent4560c7e605887fda3af63f8ce157abf94954d4d2 (diff)
downloadcpython-a549cd1fc55888e2e287714b25e2cb2251913909.zip
cpython-a549cd1fc55888e2e287714b25e2cb2251913909.tar.gz
cpython-a549cd1fc55888e2e287714b25e2cb2251913909.tar.bz2
bpo-46852: Rename float.__set_format__() to float.__setformat__() (GH-31558) (GH-31581)
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. (cherry picked from commit 7d03c8be5af2f1559dbc35b775b3116dfd63cfb6)
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 8538a05..6ac6127 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1702,7 +1702,7 @@ float___getformat___impl(PyTypeObject *type, const char *typestr)
/*[clinic input]
@classmethod
-float.__set_format__
+float.__setformat__
typestr: str
Must be 'double' or 'float'.
@@ -1721,9 +1721,9 @@ This affects how floats are converted to and from binary strings.
[clinic start generated code]*/
static PyObject *
-float___set_format___impl(PyTypeObject *type, const char *typestr,
- const char *fmt)
-/*[clinic end generated code: output=504460f5dc85acbd input=5306fa2b81a997e4]*/
+float___setformat___impl(PyTypeObject *type, const char *typestr,
+ const char *fmt)
+/*[clinic end generated code: output=06864de1fb5f1f04 input=c0e9e04dd87f9988]*/
{
float_format_type f;
float_format_type detected;
@@ -1825,7 +1825,7 @@ static PyMethodDef float_methods[] = {
FLOAT_IS_INTEGER_METHODDEF
FLOAT___GETNEWARGS___METHODDEF
FLOAT___GETFORMAT___METHODDEF
- FLOAT___SET_FORMAT___METHODDEF
+ FLOAT___SETFORMAT___METHODDEF
FLOAT___FORMAT___METHODDEF
{NULL, NULL} /* sentinel */
};