Skip to content

bpo-29526 Add reference to help('FORMATTING') in format() builtin #166

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
May 29, 2017
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
6 changes: 4 additions & 2 deletions Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,14 @@ format as builtin_format

Return value.__format__(format_spec)

format_spec defaults to the empty string
format_spec defaults to the empty string.
See the Format Specification Mini-Language section of help('FORMATTING') for
details.
[clinic start generated code]*/

static PyObject *
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec)
/*[clinic end generated code: output=2f40bdfa4954b077 input=6325e751a1b29b86]*/
/*[clinic end generated code: output=2f40bdfa4954b077 input=88339c93ea522b33]*/
{
return PyObject_Format(value, format_spec);
}
Expand Down
6 changes: 4 additions & 2 deletions Python/clinic/bltinmodule.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ PyDoc_STRVAR(builtin_format__doc__,
"\n"
"Return value.__format__(format_spec)\n"
"\n"
"format_spec defaults to the empty string");
"format_spec defaults to the empty string.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python/clinic/bltinmodule.c.h is generated file. Changes should be made in Python/bltinmodule.c. Run make clinic for regenerating Python/clinic/bltinmodule.c.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Thanks, fixing now.

"See the Format Specification Mini-Language section of help(\'FORMATTING\') for\n"
"details.");

#define BUILTIN_FORMAT_METHODDEF \
{"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__},
Expand Down Expand Up @@ -722,4 +724,4 @@ builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
/*[clinic end generated code: output=3234725ef4d8bbf1 input=a9049054013a1b77]*/
/*[clinic end generated code: output=17fedd2dec148677 input=a9049054013a1b77]*/