X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fmisc.py;h=1b3a5a94090bb2bfa7120d355d3f25683c2116f2;hb=HEAD;hp=061a5090fe96741c965f96b1f13f66e6551a4b18;hpb=586cdd1b296a1e76c7c73e695dea3dc67d59987e;p=sage.d.git diff --git a/mjo/misc.py b/mjo/misc.py index 061a509..1b3a5a9 100644 --- a/mjo/misc.py +++ b/mjo/misc.py @@ -3,7 +3,6 @@ Stuff that doesn't fit anywhere else. """ from sage.all import * -from functools import reduce def legend_latex(obj): @@ -13,32 +12,3 @@ def legend_latex(obj): legend label. """ return '$%s$' % latex(obj) - - -def product(factors): - """ - Returns the product of the elements in the list ``factors``. If - the list is empty, we return 1. - - EXAMPLES: - - Normal integer multiplication:: - - sage: product([1,2,3]) - 6 - - And with symbolic variables:: - - sage: x,y,z = SR.var('x,y,z') - sage: product([x,y,z]) - x*y*z - - TESTS: - - The empty product is the multiplicative identity (one):: - - sage: product([]) - 1 - - """ - return reduce(operator.mul, factors, 1)