8000 Add reference to help('FORMATTING') in format() builtin · python/cpython@f2ccf62 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2ccf62

Browse files
committed
Add reference to help('FORMATTING') in format() builtin
1 parent eca7da0 commit f2ccf62

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
@@ -578,12 +578,14 @@ format as builtin_format
578578
579579
Return value.__format__(format_spec)
580580
581-
format_spec defaults to the empty string
581+
format_spec defaults to the empty string.
582+
See the Format Specification Mini-Language section of help('FORMATTING') for
583+
details.
582584
[clinic start generated code]*/
583585

584586
static PyObject *
585587
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec)
586-
/*[clinic end generated code: output=2f40bdfa4954b077 input=6325e751a1b29b86]*/
588+
/*[clinic end generated code: output=2f40bdfa4954b077 input=88339c93ea522b33]*/
587589
{
588590
return PyObject_Format(value, format_spec);
589591
}

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_FASTCALL, builtin_format__doc__},
@@ -722,4 +724,4 @@ builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
722724
exit:
723725
return return_value;
724726
}
725-
/*[clinic end generated code: output=3234725ef4d8bbf1 input=a9049054013a1b77]*/
727+
/*[clinic end generated code: output=17fedd2dec148677 input=a9049054013a1b77]*/

0 commit comments

Comments
 (0)
0