Skip to content

Commit 38f90d6

Browse files
eendebakptclaude
andcommitted
Generate the map() docstring with Argument Clinic
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 8fcec2d commit 38f90d6

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

‎Python/bltinmodule.c‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,13 +1437,21 @@ map.__new__ as map_new
14371437
/
14381438
*iterables: array
14391439
strict: bool = False
1440+
1441+
Make an iterator that applies function to items of the iterables.
1442+
1443+
The function is called with one argument from each of the iterables.
1444+
Stops when the shortest iterable is exhausted.
1445+
1446+
If strict is true and one of the arguments is exhausted before the
1447+
others, raise a ValueError.
14401448
[clinic start generated code]*/
14411449

14421450
static PyObject *
14431451
map_new_impl(PyTypeObject *type, PyObject *function, PyObject *iterable,
14441452
PyObject * const *iterables, Py_ssize_t iterables_length,
14451453
int strict)
1446-
/*[clinic end generated code: output=de1354b02d08604b input=5fbe90bd74aaa2e2]*/
1454+
/*[clinic end generated code: output=de1354b02d08604b input=d3bf952f6bb775c8]*/
14471455
{
14481456
PyObject *iters = PyTuple_New(iterables_length + 1);
14491457
if (iters == NULL) {
@@ -1629,16 +1637,6 @@ static PyMethodDef map_methods[] = {
16291637
};
16301638

16311639

1632-
PyDoc_STRVAR(map_doc,
1633-
"map(function, iterable, /, *iterables, strict=False)\n\
1634-
--\n\
1635-
\n\
1636-
Make an iterator that computes the function using arguments from\n\
1637-
each of the iterables. Stops when the shortest iterable is exhausted.\n\
1638-
\n\
1639-
If strict is true and one of the arguments is exhausted before the\n\
1640-
others, raise a ValueError.");
1641-
16421640
PyTypeObject PyMap_Type = {
16431641
PyVarObject_HEAD_INIT(&PyType_Type, 0)
16441642
"map", /* tp_name */
@@ -1662,7 +1660,7 @@ PyTypeObject PyMap_Type = {
16621660
0, /* tp_as_buffer */
16631661
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
16641662
Py_TPFLAGS_BASETYPE, /* tp_flags */
1665-
map_doc, /* tp_doc */
1663+
map_new__doc__, /* tp_doc */
16661664
map_traverse, /* tp_traverse */
16671665
0, /* tp_clear */
16681666
0, /* tp_richcompare */

‎Python/clinic/bltinmodule.c.h‎

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)