Skip to content

bpo-46852: Rename float.__set_format__() to float.__setformat__() #31558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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. Patch by Victor Stinner.
24 changes: 12 additions & 12 deletions Objects/clinic/floatobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Objects/floatobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ float___getformat___impl(PyTypeObject *type, const char *typestr)

/*[clinic input]
@classmethod
float.__set_format__
float.__setformat__

typestr: str
Must be 'double' or 'float'.
Expand All @@ -1781,9 +1781,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;
Expand Down Expand Up @@ -1885,7 +1885,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 */
};
Expand Down