MCPcopy Index your code
hub / github.com/python/cpython / prod

Function prod

Lib/test/test_buffer.py:275–282  ·  view source on GitHub ↗

Product of list elements.

(lst)

Source from the content-addressed store, hash-verified

273 return isinstance(lst, list)
274
275def prod(lst):
276 """Product of list elements."""
277 if len(lst) == 0:
278 return 0
279 x = lst[0]
280 for v in lst[1:]:
281 x *= v
282 return x
283
284def strides_from_shape(ndim, shape, itemsize, layout):
285 """Calculate strides of a contiguous array. Layout is 'C' or

Callers 11

carrayFunction · 0.70
farrayFunction · 0.70
cast_itemsFunction · 0.70
verifyMethod · 0.70
test_ndarray_multidimMethod · 0.70
test_prodMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…