Skip to content

Commit 6e3aa8a

Browse files
aktechserhiy-storchaka
authored andcommitted
[3.6] bpo-29526: Add reference to help('FORMATTING') in format() builtin (GH-166).
(cherry picked from commit 2e6bb44)
1 parent 4a8b53a commit 6e3aa8a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Python/bltinmodule.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,14 @@ format as builtin_format
588588
589589
Return value.__format__(format_spec)
590590
591-
format_spec defaults to the empty string
591+
format_spec defaults to the empty string.
592+
See the Format Specification Mini-Language section of help('FORMATTING') for
593+
details.
592594
[clinic start generated code]*/
593595

594596
static PyObject *
595597
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec)
596-
/*[clinic end generated code: output=2f40bdfa4954b077 input=6325e751a1b29b86]*/
598+
/*[clinic end generated code: output=2f40bdfa4954b077 input=88339c93ea522b33]*/
597599
{
598600
return PyObject_Format(value, format_spec);
599601
}

Python/clinic/bltinmodule.c.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ PyDoc_STRVAR(builtin_format__doc__,
7777
"\n"
7878
"Return value.__format__(format_spec)\n"
7979
"\n"
80-
"format_spec defaults to the empty string");
80+
"format_spec defaults to the empty string.\n"
81+
"See the Format Specification Mini-Language section of help(\'FORMATTING\') for\n"
82+
"details.");
8183

8284
#define BUILTIN_FORMAT_METHODDEF \
8385
{"format", (PyCFunction)builtin_format, METH_VARARGS, builtin_format__doc__},
@@ -674,4 +676,4 @@ builtin_issubclass(PyObject *module, PyObject *args)
674676
exit:
675677
return return_value;
676678
}
677-
/*[clinic end generated code: output=63483deb75805f7c input=a9049054013a1b77]*/
679+
/*[clinic end generated code: output=2ef82846acdfa0f5 input=a9049054013a1b77]*/

0 commit comments

Comments
 (0)