MCPcopy Index your code
hub / github.com/RustPython/RustPython / prod

Function prod

Lib/test/test_buffer.py:263–270  ·  view source on GitHub ↗

Product of list elements.

(lst)

Source from the content-addressed store, hash-verified

261 return isinstance(lst, list)
262
263def prod(lst):
264 """Product of list elements."""
265 if len(lst) == 0:
266 return 0
267 x = lst[0]
268 for v in lst[1:]:
269 x *= v
270 return x
271
272def strides_from_shape(ndim, shape, itemsize, layout):
273 """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 1

lenFunction · 0.85

Tested by

no test coverage detected