Source code

Download source archive ↓

src/openpyxl/compat/product.py

1# Copyright (c) 2010-2024 openpyxl
2
3"""
4math.prod equivalent for < Python 3.8
5"""
6
7import functools
8import operator
9
10def product(sequence):
11    return functools.reduce(operator.mul, sequence)
12
13
14try:
15    from math import prod
16except ImportError:
17    prod = product