10000 gh-119793: Prefer `map(..., strict=True)` over starmap/zip in example… · python/cpython@3d4fda2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d4fda2

Browse files
authored
gh-119793: Prefer map(..., strict=True) over starmap/zip in examples (#126407)
1 parent 4a0d574 commit 3d4fda2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Doc/library/math.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ Number-theoretic and representation functions
406406

407407
Roughly equivalent to::
408408

409-
sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))
409+
sum(map(operator.mul, p, q, strict=True))
410410

411411
For float and mixed int/float inputs, the intermediate products
412412
and sums are computed with extended precision.

Modules/clinic/mathmodule.c.h

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

Modules/mathmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,15 +2710,15 @@ Return the sum of products of values from two iterables p and q.
27102710
27112711
Roughly equivalent to:
27122712
2713-
sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))
2713+
sum(map(operator.mul, p, q, strict=True))
27142714
27152715
For float and mixed int/float inputs, the intermediate products
27162716
and sums are computed with extended precision.
27172717
[clinic start generated code]*/
27182718

27192719
static PyObject *
27202720
math_sumprod_impl(PyObject *module, PyObject *p, PyObject *q)
2721-
/*[clinic end generated code: output=6722dbfe60664554 input=82be54fe26f87e30]*/
2721+
/*[clinic end generated code: output=6722dbfe60664554 input=a2880317828c61d2]*/
27222722
{
27232723
PyObject *p_i = NULL, *q_i = NULL, *term_i = NULL, *new_total = NULL;
27242724
PyObject *p_it, *q_it, *total;

0 commit comments

Comments
 (0)
0