From eec2dab4abbe647fa3cfb38b9c3295fc64481cef Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 22 Oct 2019 12:14:10 +0100 Subject: [PATCH] pock: Use `MPMul' so that we can avoid `reduce'. For some reason, Python 3 hides `reduce' away in some library module. Anyway, we have a very efficient mass-multiplier so we might as well use it. --- pock | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pock b/pock index a980cbe..377b811 100644 --- a/pock +++ b/pock @@ -49,12 +49,8 @@ class ExpectedError (Exception): pass def prod(ff, one = 1): - """ - Return ONE times the product of the elements of FF. - - This is not done very efficiently. - """ - return reduce(lambda prod, f: prod*f, ff, one) + """Return ONE times the product of the elements of FF.""" + return C.MPMul().factor(one).factor(ff).done() def parse_label(line): """ -- 2.11.0